简体   繁体   中英

Android - Launch Intent as new app

Is it possible to launch an Intent as a new application?

Wanted behaviour:

  • The user clicks a button in my app.
  • The media player Intent is launched and plays the desired media.
  • The user long-press the home button . In this menu, I would like to see both the media player and my app. I would like the user to be able to listen to the music using his desired media player and being able to put my app in foreground.

Thanks

I am not sure as I've never used it, but I guess you could use the intent flag FLAG_ACTIVITY_NEW_TASK for this.

Intent intent = your intent;
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)

See http://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NEW_TASK for more info.

Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM