My push notification has text containing more than 3 lines. So, in pending intent I am passing CustomDialogActivity. On click of push notification a CustomDialogActivity is opened and on OK press ,I am finishing the CustomDialogActivity.
Case 1: When the application is running and Push Notification comes all goes fine.
Case 2: When the user quits the application and Push Notification comes then on click of it CustomDialogActivity is opened. On pressing OK of it the activity finishes.
Now, after case 2, if we long press home button "Recent apps" will be opened.
When I clicked on my application then again the CustomDialogActivity is opened.
And on click of OK it finishes. this keeps on repeating.
MANIFEST:
activity android:name="com.mypackage.CustomDialogActivity"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Dialog"
Note: CustomDialogActivity is passed as pending intent.
How should I fix this?
Try to use android:excludeFromRecents="true"
flag in declaring activity in manifest.