Android的URL方案不起作用 [英] Android URL scheme doesn't work

查看:467
本文介绍了Android的URL方案不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的code。我看了其他的帖子这个问题。他们说,他们的code的工作非常出色。
而我的code几乎相同,他们的。为什么没有在我的测试工作。我的设备是三星I9300。

This is my code. I have read other's post about this issue. They said their code worked very well. And my code almost the same as theirs. Why doesn't it work in my test. my device is Samsung 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>

在命令行和它susccessfully推出,而在布劳尔简化版,工作中使用的网址

PS:我用// -a android.intent.action.VIEW ADB -d外壳上午开始-d haibintest。

ps: I using "adb -d shell am start -d haibintest:// -a android.intent.action.VIEW" on command line and it launch susccessfully, while use the url in the brower does't work.

PS2:我测试它在歌剧和它的工作非常好,所以我知道它不会在某些浏览器和设备的正常工作

ps2: I test it in opera and it work very well , so i know it will not work in some browers and devices.

推荐答案

要使用URL方案里面ADB可以使用以下命令行:

To use url scheme inside adb you can use the following command line:

adb shell 'am start "intent:#Intent;scheme=yourscheme://yoururl?param1=value1;end"'

或者,你甚至可以用QR codeS做到这一点:
转到 ZXing 并生成这种格式的URL:

Or you can even do it with QrCodes: Go to ZXing and generate a url of this format:

yourscheme://yoururl?param1=value1

然后像的酒吧codeScanner

这篇关于Android的URL方案不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆