【发布时间】:2014-04-09 16:24:03
【问题描述】:
所以我在 Manifest 中声明了这么棘手的事情,以便能够从浏览器启动我的应用程序:
<activity android:name=".BrowserIntentCallBackActivity"
android:noHistory="true" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="*"
android:scheme="trickyapp" />
</intent-filter>
</activity>
这工作正常并按预期启动我的BrowserIntentCallBackActivity。如果我的应用程序之前没有启动,那么完成 BrowserIntentCallBackActivity 会将用户返回到浏览器并且它很好。
但是,如果我的应用程序之前已启动并在后台运行,则 BrowserIntentCallBackActivity 会将用户返回到我的应用程序的 previuos 活动。但是我想将用户发送回浏览器,他/她在其中单击了非常特殊的链接,并且我的BrowserIntentCallBackActivity 是由intent 启动的。而且我不想杀死我正在运行的应用程序。
如何做到这一点?
【问题讨论】:
标签: android android-intent android-activity