4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

[Android]ディープリンクへの対応手順

Last updated at Posted at 2020-04-15

ディープリンクへの対応手順

以下の手順となります。

マニフェストを設定 1

<intent-filter android:label="test" >
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data
                        android:host="test"
                        android:scheme="example" />
     </intent-filter>
applink_1.png

Intent からデータを取得 2

val action: String? = intent?.action
    val data: Uri? = intent?.data
        if(data!= null) {
            val dataString = data.toString()
            if(dataString.equals("example://test")){
            intent = Intent (this, DeepActivity::class.java)
            startActivity(intent)
            } 
        }
link_2.png

aタグ(ディープリンク)からアプリを起動 3
端末のbrowserからhtmlページをロードしてリンクをタップし、アプリが起動すること

<a href="example://test"> example://test</a>
4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?