Detailed explanation of the use of Scheme protocol in Android to evoke App

  • 1. Scheme is an in-page jump protocol; by defining your own scheme protocol, you can easily jump to each page in the app.

  • 2. When to use
    1. The server sends the jump path, and the client jumps to the corresponding page according to the jump path sent by the server.
    2. The APP jumps to another APP specified page according to the URL.

  • 3.格式
    myscheme://myhost:8888/macthDetail?macthId=222&name=hello

  • 4. Used in app

                	//三个action必填
                    <action android:name="android.intent.action.VIEW"/>
                    <category android:name="android.intent.category.DEFAULT"/>
                    <category android:name="android.intent.category.BROWSABLE"/>
                    <data android:scheme="myscheme"
                        android:host="myhost"
                        android:port="8888"
                        android:path="/macthDetail"/>
    
    
  • 5. call

    Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("myscheme://myhost:8888/macthDetail?macthId=222&name=hello"));
    startActivity(intent); 
    
    

Guess you like

Origin blog.csdn.net/qq_39735878/article/details/126040663