【发布时间】:2017-12-12 06:36:55
【问题描述】:
我正在开发一个 android 应用程序,因为我添加了共享 whatsapp 共享功能,我已经成功完成,现在我想在用户单击我共享的链接时打开我的 android 应用程序的特定活动。我已经搜索链接很少,但没有运气,我希望有朋友能帮助我。
添加清单
<activity
android:name=".ProductDescriptionActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="com.abc.allaboutcity.MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http"
android:host="http://allaboutcity.in"
android:pathPrefix="/allaboutcity" />
</intent-filter>
<intent-filter >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://gizmos” -->
<data android:scheme="allaboutcity"
android:host="allaboutcity" />
</intent-filter>
</activity>
【问题讨论】:
-
在清单中添加您的活动并在其中设置所需的意图过滤器和所需的方案!
-
如果您想分享您的域的链接并且您想链接到您的应用活动,那么您想分享什么样的链接然后结帐developer.android.com/training/app-links/deep-linking.html
-
@Xenolion -感谢您的参考朋友,但我的问题与此无关,我需要的是当有人点击已经从我的应用程序共享到whatsapp的链接(IN WHATSAPP)时,它应该重定向到我的应用程序并打开特定的活动。你收到了吗?
标签: android android-intent deep-linking