美文网首页
安卓Scheme协议的使用详解

安卓Scheme协议的使用详解

作者: 皓皓amous | 来源:发表于2023-12-03 17:46 被阅读0次
    
    <activity android:name="com.example.myapplication.scheme.SchemeActivity"
                android:exported="true">
                <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="testsq"
                        android:host="poeer"
                        android:port="9999"
                        android:path="/ddsdddssd"
                        />
                </intent-filter>
            </activity>
    
    
    zymobi://3g2win:9999/macthDetail?macthId=222&time=10001
    scheme :代表该Schema 协议名称zymobi
    host: 代表Schema作用于哪个地址域  3g2win
    port:; 代表该路径的端口号9999
    path 代表Schema指定的页面  /macthDetail
    -- 代表传递的参数  ?macthId=222&time=10001
    
    
    
       Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("testsq://poeer:9999/ddsdddssd"));
                    startActivity(intent);
    
    

    相关文章

      网友评论

          本文标题:安卓Scheme协议的使用详解

          本文链接:https://www.haomeiwen.com/subject/avtlgdtx.html