Questions tagged [launchmode]

176 questions
6
votes
2 answers

Why Behaviours are different ?- android:launchMode="singleTask" , android:taskAffinity="" And Intent.FLAG_ACTIVITY_NEW_TASK

I have Four Activity - A,B,C,D I am calling these four activity in manner --> A-B-C-D-B. (Specified Manner) I have three scenario. 1st :- I am defining android:launchMode="singleTask" only in B Activity. And I am calling all activity via Intent in…
zephyr
  • 665
  • 6
  • 19
5
votes
3 answers

Android: launchMode=SingleTask problem

I have an app that circles around the main activity (a main menu). In each other app there is an option menu item that directs to this activity. At first, I always started a new main activity when this item was selected. Using the intent bundle, I…
jellyfish
  • 7,868
  • 11
  • 37
  • 49
5
votes
1 answer

launchMode being overriden by Google Files app when sharing? New instance of a single activity forced?

I have a app that is a share target. It is a single activity architecture with launchMode="singleTask" in the manifest. All other apps when sharing their data to my app, seem to honor this, so, the same instance gets opened, even if the activity was…
urSus
  • 12,492
  • 12
  • 69
  • 89
5
votes
1 answer

singleTask and singleInstance not respected when using PendingIntent?

I have an activity with launchMode set to singleTask: I have an ongoing notification with a PendingIntent that launches that activity: Intent…
Kevin
  • 702
  • 7
  • 22
4
votes
3 answers

How to hande each Intent once when using singleTask

I'm using a singleTask-mode activity that handles a certain type of files by specifying a intent-filters. I need to handle each such file Intent exactly once. The problem is onNewIntent() is only called if the task is already alive, forcing me to…
Ytai
  • 41
  • 2
4
votes
4 answers

android - launchMode=singleTask and Notifications?

I know there's been a few posts for what I'm about to ask but I can't find any with the right answer. From my understanding, if your main activity's (let's call it A) launchMode is set to singleTask, and A has initiated activity B then a click to…
kkudi
  • 1,625
  • 4
  • 25
  • 47
4
votes
2 answers

Double tap on custom view opens up 2 Activities

I have few custom hexagon views in my fragment and upon double tapping on hexagon view,it opens up 2 Activties. I have tried several things to avoid this behaviour and none of it seems to work. Not sure why following things are not working. I have…
androidbash
  • 390
  • 1
  • 4
  • 21
4
votes
1 answer

Setting android:launchmode for UnityPlayerActivity

I'm building an Android game on Unity which has a button that opens a new activity. The problem is when building the APK, no matter what I put in my custom AndroidManifest.xml, Unity overrides it and sets android:launchMode for…
4
votes
1 answer
4
votes
1 answer

Multiple instances of app in recent app list of tablet(android)

I have two activities in my app. First activity launchmode is singleInstance and second activity launchmode is singleTask. I am using these launchmodes because i don't want to destroy any of the activity while switching between them. App is working…
4
votes
2 answers

Android ActivityRecord in proc activity list using null instead of expected ProcessRecord

My app frequently crashes when using launchmode 'SingleTop'. Removing the SingleTop fixes this but I'm curious as to why exactly this is happening and if there is something I am missing when using this launchmode? ActivityRecord in proc activity…
Jordy
  • 1,764
  • 1
  • 22
  • 32
4
votes
3 answers

Android: when should I use singleInstance launchmode

There are four launch modes for an Activity, standard, singletop, singletask, and singleInstance. The previous three are relatively easy understanding and widely used. But till now, I did not find any scenario using singleInstance. Some of the real…
mianlaoshu
  • 2,342
  • 3
  • 27
  • 48
4
votes
1 answer

Activities with singleTask launch mode and their position in the back stack

In the official online Android guide on tasks and back stack, there's a piece of information i find self-contradicting. So i'd be grateful if somebody could help me figure it out. First off, there's the following statement: Activities in the stack…
4
votes
1 answer

Why does Android launch multiple instances on singleTask or singleInstance?

What I want to achieve: The MainActivity should be reused, in other words, I don't want to run onCreate() over again, but only onResume() on the same Activity, but I have a strange behaviour. It seems that the launchMode in AndroidManifest is…
Bevor
  • 8,396
  • 15
  • 77
  • 141
4
votes
3 answers

singleTop Activity sometimes being created even when on top of stack

I have an Activity whose launchMode is singleTop (in the manifest). My understanding is that if an Activity is singleTop and it is on top of the activity stack, then launching an the Activity with a new Intent will actually result in onNewIntent()…
1
2
3
11 12