Android, how to bring a Task to the foreground?

后端 未结 4 1975
情书的邮戳
情书的邮戳 2020-12-16 05:25

My question:

How can I launch a new Activity in its own Task while using the following rules.

1) If the Activity already exists as a root of a another Tas

4条回答
  •  抹茶落季
    2020-12-16 06:11

    You can set the Activity's launch mode (android:launchMode) in the AndroidManifest so that it does not create new instances of itself if it is running, but will launch normally when it is not. Then you can start an Activity using Intent.

提交回复
热议问题