简体   繁体   中英

Same scheme url does not open the target activity when app is already running

I am opening my application using scheme url from browser. I have an activity say ActivityA that opens up when user clicks a link on a browser and which then starts another activity say ActivityB and finish itself. Now if i have 4 different links with same scheme, all are opening my app properly. But when i follow the following procedure

  1. Click on the first link, it opens up the ActivityA which then starts ActivityB.
  2. Now the app is running in background. If I click on second link it also opens up ActivityA. Result is same for third and fourth link.
  3. Now if i again click on the first link while app is running in background, it does not open ActivityA, rather it just brings the app to front.

您可以在AndroidManifest.xml中设置clearTaskOnLaunch =“true”如果您从应用程序启动浏览器而不是在新任务中启动浏览器(使用FLAG_ACTIVITY_NEW_TASK),并完成当前活动(以完成当前任务)。

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