uri呼起activity

編寫過濾器

<activity
    android:name="org.daniel.android.test.CallUpActivity"
    android:label="@string/app_name" >
    <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="myapp" android:host="org.daniel.android.test"/>
    </intent-filter>
</activity>

編寫頁面

<html>
    <head>
        <title>Intent test</title>
    </head>
    <body>
        <a href="myapp://org.daniel.android.test/callup">MyApp</a>
    </body>
</html>

注意:

  • schema必須都是小寫字母,而且不能有數字
  • host也都是小寫字母

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