2015-09-24 43 views
0

我有一個活動,顯示名人和一些信息。Android Deeplink如何使用現有的Activity進行處理Intent?

宣言清單:

<activity 
      android:name=".CelebrityActivity" 
      android:configChanges="orientation|screenSize" 
      android:label="@string/title_activity_celebrities" 
      android:launchMode="singleInstance" 
      android:screenOrientation="portrait"> 
      <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:scheme="some_scheme" /> 
      </intent-filter> 
     </activity> 

this guide

例如,命令下面試圖查看與指定的URI相關聯的目標應用程序的活動。

$ adb shell am start 
    -W -a android.intent.action.VIEW 
    -d "example://gizmos" com.example.android 

我的問題是,當我執行ADB命令(你在上面看到),它再現了我的活動始終,即使活動啓動。

我嘗試添加launchMode:singleInstance標誌,但是...沒有變化。活動也重新創建。

所以我的問題是如何處理結果在現有的活動

回答

0

我相信你需要使用的

adb shell am broadcast -a "android.intent.action.VIEW" -d "some_scheme://" 

代替adb shell am start。鏈接由android框架作爲廣播處理。

相關問題