简体   繁体   English

在Android上通过自定义URL方案打开但不重新启动应用程序

[英]Open but not restart app via a Custom URL scheme on Android

I register an url scheme for my android app and configure file as following shows, however, it will restart the app every time by this way. 我为我的android应用程序注册了一个url方案并配置文件,如下所示,但是,它将以此方式每次重新启动应用程序。 How could I only make it just open app , not restart it? 我如何才能使其仅打开应用程序,而不重新启动它? Thanks. 谢谢。

<intent-filter>
                <data android:scheme="myapp"/>

                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
 </intent-filter> 

尝试为您要调用的Activity设置android:launchMode="singleInstance"参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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