In my app I am launching any apps like whatsapp,messenger,chrome,etc. using 
this code:
For e.g. I am launching messaging app from inside my app using this code:

Intent intent=getPackageManager().getLaunchIntentForPackage("
com.android.mms");
       intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
       startActivity(intent);


The above code launches the messaging app perfectly from my app .When I 
again launch the previously launched messaging app from inside my app again 
it bring the messaging app to front and resumes it if it is already running 
in background.But the problem is that when I launch the same messaging app 
from my android default phone launcher it just create a new instance on 
above of already running messaging app which was launched before by my app.

So, in short my problem is I want to launch any apps from my app using its 
package name and if the particular app is already running in the background 
I want it to just bring it to front ,i don't want to create new instance of 
launched app(messenger) each time.Please help me I am working on it on past 
few weeks but not gotten any solution.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/e10c2abb-0659-40e3-b191-37b3e5236a23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to