Skip to content Skip to sidebar Skip to footer

Check For Activity Is Onscreen When Notification Is Clicked ?(using Intent)

I am trying to add upload image feature in my application, using android-upload-service. I am facing a issue not specific to the library. When i am clicking on upload notification

Solution 1:

Add launchMode="singleTop" to the <activity> definition in the manifest. That should be enough to do what you want. It tells Android that it should use an existing instance of the Activity instead of creating a new one, if an instance of that Activity already exists at the top of the activity stack in the task.

Please don't use one of the special launch modes singleTask or singleInstance as these usually create more problems than they solve if you do not know exactly what you are doing.

Solution 2:

First, add android:launchMode="singleTask" for that activity in your AndroidManifest.xml file. This will make sure that there is only one instance of the activity at all time.

Example,

<activityandroid:name=".activities.MyActivity"android:launchMode="singleTask"/>

Post a Comment for "Check For Activity Is Onscreen When Notification Is Clicked ?(using Intent)"