savepopulation savepopulation - 2 months ago 14
Android Question

Android Launch Mode Single Task

In my app i have a dashboard activity and it's launch mode is "SingleTask" Are there any chances that my app gets in onNewIntent without onCreate?

For example if user navigates to another activity from Dashboard and after Dashboard is destroyed, what happens if user navigates to dashboard again?

Will onCreate work or just will go on from onNewIntent?


Answer Source

According to the Android API docs, onNewIntent will only get called for:

activities that set launchMode to "singleTop" in their package, or if a client used the FLAG_ACTIVITY_SINGLE_TOP flag when calling startActivity(Intent).

Since you are using SingleTask, onNewIntent should not get called.