从网页(包括app中webview)打开APP

只需要在需要打开的activity标签下添加intent-filter

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

       <category android:name="android.intent.category.BROWSABLE" />
       <category android:name="android.intent.category.DEFAULT" />
       <!-- scheme是必须的,其他的不必须 -->
       <data
            android:scheme="xiaohouzi"
            android:host="hou"
            android:sspPrefix="/123"
            android:port=""
          />
</intent-filter>

html页面中需要超链接地址

<a href="xiaohouzi://hou/123">点击打开应用</a>

这样点击打开应用时就会跳到注册了的activity

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章