Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安卓URL方案没有';行不通_Android - Fatal编程技术网

Android 安卓URL方案没有';行不通

Android 安卓URL方案没有';行不通,android,Android,这是我的密码。我读过其他人关于这个问题的帖子。他们说他们的代码运行得很好。 我的代码和他们的几乎一样。为什么它在我的测试中不起作用。我的设备是三星I9300 <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" >

这是我的密码。我读过其他人关于这个问题的帖子。他们说他们的代码运行得很好。 我的代码和他们的几乎一样。为什么它在我的测试中不起作用。我的设备是三星I9300

   <application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.haibin.androidtest.MainActivity"
        android:label="@string/app_name"
        android:exported="true" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <data android:scheme="haibintest"/>

            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
        </intent-filter>
    </activity>
</application>

ps:我在命令行上使用了“adb-dshellam start-d haibinstest://-a android.intent.action.VIEW”,它成功地启动了,而在浏览器中使用url则不起作用


ps2:我在opera中测试了它,它工作得很好,所以我知道它在某些浏览器和设备中不起作用。

要在adb中使用url方案,可以使用以下命令行:

adb shell 'am start "intent:#Intent;scheme=yourscheme://yoururl?param1=value1;end"'
或者您甚至可以使用QrCodes: 转到并生成此格式的url:

yourscheme://yoururl?param1=value1

然后使用QrCode应用程序(如

)对其进行扫描,以便在adb内部使用url方案。您可以使用以下命令行:

adb shell 'am start "intent:#Intent;scheme=yourscheme://yoururl?param1=value1;end"'
或者您甚至可以使用QrCodes: 转到并生成此格式的url:

yourscheme://yoururl?param1=value1
然后用QrCode应用程序扫描它,如