1
알림에서 Android 앱을 다시 시작하려면 어떻게해야하나요? 나는 완전히 새로운 인스턴스가 아닌 모든 바운드 된 서비스 및 설정 등을 사용하여 인스턴스를 다시 시작할 수 있기를 원합니다. 이건 내 코드입니다 : 나는 종류의 해답을 발견알림에서 Android 앱 다시 시작
String ns = Context.NOTIFICATION_SERVICE;
mNotificationManager = (NotificationManager)
getSystemService(ns);
Intent notificationIntent = new Intent(this, MeasurementsStarter.class);
PendingIntent contentIntent = PendingIntent.getActivity(
this, 0, notificationIntent, 0);
// the next two lines initialize the Notification, using the configurations
// above
notification = new Notification(R.drawable.ic_launcher, "Metingen draaien",System.currentTimeMillis());
notification.setLatestEventInfo(getBaseContext(), "Metingen ManDown", "Metingen Mandown draaien nog",
contentIntent);
notification.flags = Notification.FLAG_ONGOING_EVENT | Notification.FLAG_NO_CLEAR;
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
final int HELLO_ID = 1;
mNotificationManager.notify(HELLO_ID, notification);