从启动浏览器Android应用程序 [英] Launch Android application from browser

查看:200
本文介绍了从启动浏览器Android应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题。

我有一个Android的活动,我想从浏览器上的一个环节运行它。

I have an Android Activity, and I want to run it from one link on the browser.

这是怎样我宣布我的清单文件活动:

This is what how I have declared my Activity on the Manifest file:

<activity android:name=".Wul4"
        android:windowSoftInputMode="adjustPan"
        android:configChanges="keyboardHidden|orientation"
        android:launchMode="singleInstance"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="wul4" android:host="com.wul4.wul4"/>
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>

在web应用程序,启动应用程序的链接是下列之一:

On the webApp, the link to launch the application is the following one:

wul4://com.wul4.wul4?codOperacion="+respuestaActual.idOperacion

问题的关键是,它是从以下浏览器中工作:歌剧和谷歌浏览器,但它不工作,其余..........(例如,它不工作在电话的默认浏览器)。

The point is that It is working from the following browsers: "Opera" and "Google Chrome", but it is not working for the rest..........(for instance, it is not working on the default browser of the phone).

任何人都知道这是为什么?

Anyone knows why???

非常感谢!

推荐答案

试试这个,使用HTTP,而不是自己的模式的:

Try this one, using HTTP instead of your own schema:

<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:host="com.wul4.wul4"
    android:scheme="http:" />
</intent-filter>

当这个域名的链接被点击的Andr​​oid设备,用户是一个对话框psented你的App(如果已安装)或浏览器之间进行选择$ P $。

When a link with this domain is clicked in an Android device, the user is presented with a dialog to choose between your App (if installed) or the Browser.

这篇关于从启动浏览器Android应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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