Answer the question
In order to leave comments, you need to log in
How to wake up an Activity?
The situation is this: Activity (MainActivity) starts the service, after which I press the HOME button. The activity is in the onStop state, the service is running. When the service terminates, it creates a notification, a standard NewMessageNotification created from the AndroidStudio template. Attached to this notice is the intent:
notificationCompatBuilder.setContentIntent(
PendingIntent.getActivity(context, 0,
new Intent(context, MainActivity.class),
PendingIntent.FLAG_UPDATE_CURRENT))
Answer the question
In order to leave comments, you need to log in
<activity
android:name=".YourActivity"
android:launchMode="singleTask"/>
Pretty strange behavior... If I'm not confused, clicking on the notification should just "wake up" the old activity. Have you tested this on the same device/sdk version?
As a tip - try playing around with the activity flags in the manifest. But again, strange behavior...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question