I have an activity which I can start from Launcher . I have made some changes to Navigation bar so that i can start the same activity from navigation bar also.
But the expected behavior is that the activity should not start again if it is already on top of stack so I used FLAG_ACTIVITY_SINGLE_TOP as flag. But it does not seam to work. I know that we can also achieve it specifying the launchmode
as singleTask
. But i dont want to use that as I may be starting some 3rd party apps from navigation bar
Have you tried
launchMode:singleTop
in the definition of your activity in the manifest? e.g.
<activity
android:name=".MyActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:launchMode="singleTop">
</activity>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With