1
我已經在我的應用程序中實現了深度鏈接。果然,當我點擊瀏覽器中的鏈接時,它會打開應用程序。但是,當我做深層鏈接啓動應用程序,但說uri爲空
Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();
兩個action
和data
爲空。什麼會導致這樣的事情?我想象它打開我的應用程序意味着它有一個uri。
這裏是我的意圖過濾
<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="www.mywebsite.com"
android:scheme="http"/>
<data
android:host="www.mywebsite.com"
android:scheme="https"/>
<data
android:host="mywebsite.com"
android:scheme="http"/>
<data
android:host="mywebsite.com"
android:scheme="https"/>
<data
android:host="/*"
android:scheme="mywebsite"/>
</intent-filter>
您確定您正在檢查右側「活動」的「意圖」嗎? (例如,當您在下面的活動中檢查意圖時,您的'intent-filter'在啓動Activity上設置) –
對不起,遲了回覆@KenVanHoeylandt。你釘了它。我正在使用Splash活動並忘記了這一點。所以謝謝你指出可能看得見的東西。 –
不客氣!我會將它作爲答案發布,以便您可以批准它。 –