2015-05-15 38 views
0

我不知道它是否真的可以理解。意圖過濾器 - 打開新的應用程序,不嵌入一個

當我點擊郵件中的鏈接時,我可以打開這個鏈接與我的應用程序,這是完美的我想要的。

<intent-filter> 
    <data android:scheme="https" android:host="xxx.xxx.com"/> 
    <action android:name="android.intent.action.VIEW"/> 
    <category android:name="android.intent.category.BROWSABLE"/> 
    <category android:name="android.intent.category.DEFAULT"/> 
</intent-filter> 

,當我打開我的應用程序那樣的,我檢查打開的應用程序,我看到我的應用程序是「內部」的Gmail任務,像

enter image description here

但是,當我打開與Chrome的鏈接爲例,Chrome在他自己的任務中打開,就像那樣

enter image description here

我的應用程序如何在她自己的任務中打開,並且不是在Gmail的內部?

回答

2

你必須設置一個特定的andorid:launchMode到你的活動:

android:launchMode="singleTask" 

android:launchMode="singleInstance" 

放在你的活動在AndroidManifest.xml聲明將做到這一點。

看看還在this一篇文章,解釋如何Android的手柄任務和活動

+1

哦,對了,我剛看到,我還沒有添加任何launchmode呢。 我正在嘗試並在謝謝 –

+1

之後重新評論謝謝 –

相關問題