安卓Scheme协议的使用详解

2023-12-03  本文已影响0人  皓皓amous

<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);

上一篇 下一篇

猜你喜欢

热点阅读