标准的意图URI坏了吗? [英] Standard intent URI broken?

查看:270
本文介绍了标准的意图URI坏了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题与特定的设备上的意图的URI,所以我想这里建议CommonsWare URLHandler示例:的使用意图的URI 启动我的应用程序,并在其样本页面的意图URI超链接也无法调用应用程序。此示例声明其意图过滤器是这样的:

I'm having problems with intent URIs on a particular device, so I tried the CommonsWare URLHandler sample as suggested here: Launching my app using the intent URI, and the intent URI hyperlink on its sample page also fails to invoke the application. The sample declares its intent-filter like this:

<intent-filter>
    <action android:name="com.commonsware.android.MY_ACTION" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
</intent-filter>

和样品网页的超链接:

<a href="intent:#Intent;action=com.commonsware.android.MY_ACTION;end">Link back to URLHandler via intent: URL</a>

这适用于大多数设备,但不是在HTC惊奇4G,运行Android 4.0.3。当我接触到的链接,在logcat中给出了:

This works on most devices, but not on the HTC Amaze 4G, running Android 4.0.3. When I touch the link, The logcat gives:

I/PRIME(9029): <CallBackProxy> Send to WebViewClient.
I/PRIME(9029): <Browser> Send to HtcLinkifyDispatcher
I/ActivityManager(262): START intent from pid 9029
D/MP-Decision(891): Aggress decision engine: Off
D/MP-Decision(891): Switch back to normal parameters: 
    Nw=2.700000, Tw=180, Ns=2.100000, Ts=270, Decision_ms=100, Poll_ms=10
V/NfcService(600): setForegroundNdefPush msg = null callback = null
D/HtcTelephony(561): requestSetFastDormancy: module=0 mode=0
D/WebViewTimersControl(9029): onBrowserActivityPause
D/WebViewTimersControl(9029): Pausing webview timers, 
   view=com.android.browser.BrowserWebView@40e562f8
I/ActivityManager(262): Start proc com.htc.HtcLinkifyDispatcher for 
   activity com.htc.HtcLinkifyDispatcher/.HtcLinkifyDispatcherActivity: 
   pid=11087 uid=1000 gids={1015, 3002, 3001, 3003, 5001, 5003, 3007, 3006, 2001, 1007}
D/ConnectivityService(262): onUidRulesChanged(uid=1000, uidRules=0)
V/browser(9029): BrowserActivity.onWindowFocusChanged
D/HtcLinkifyDispatcherActivity(11087):  @@@@@ receive action=com.commonsware.android.MY_ACTION
I/HtcAppAssociationsUtils (Dispatcher)(11087):  @@@@@ enable by 2 = true
I/HtcAppAssociationsUtils (Dispatcher)(11087):  @@@@@ method = 0
I/HtcAppAssociationsUtils (Dispatcher)(11087):  @@@@@ check enable = true
D/MP-Decision(891): Aggress decision engine: On
D/ActivityManager(262): Config after re-evaluted by window manager: null
D/MP-Decision(891): Switch to aggressive parameters: 
    Nw=1.990000, Tw=140, Ns=1.400000, Ts=190, Decision_ms=50, Poll_ms=10
V/browser(9029): BrowserActivity.onWindowFocusChanged
D/HtcTelephony(561): requestSetFastDormancy: module=0 mode=1
W/InputManagerService(262): Window already focused, ignoring focus gain of: 
    com.android.internal.view.IInputMethodClient$Stub$Proxy@40e75100
D/WebViewTimersControl(9029): onBrowserActivityResume
D/WebViewTimersControl(9029): Resuming webview timers, 
    view=com.android.browser.BrowserWebView@40e562f8
W/BaseUi(9029): mMainView is already attached to wrapper in attachTabToContentView!
W/BaseUi(9029): mContainer is already attached to content in attachTabToContentView!
V/NfcService(600): setForegroundNdefPush msg = null 
    callback = android.nfc.INdefPushCallback$Stub$Proxy@40e73470
D/memalloc(9029): /dev/pmem: Unmapping buffer base:0x569c5000 size:4386816 offset:4177920
D/browser(9029): [BrowserActivity::Connectivity_Type] ===== 1
I/ActivityManager(262): No longer want 
    com.htc.providers.settings:remote (pid 10935): hidden #16, adj=15
D/Process(262): killProcessQuiet, pid=10935
D/Process(262): dalvik.system.VMStack.getThreadStackTrace(Native Method)
D/ConnectivityService(262): onUidRulesChanged(uid=1000, uidRules=0)
D/Process(262): java.lang.Thread.getStackTrace(Thread.java:599)
D/Process(262): android.os.Process.killProcessQuiet(Process.java:823)
D/Process(262): com.android.server.am.ActivityManagerService.updateOomAdjLocked(ActivityManagerService.java:15132)
D/Process(262): com.android.server.am.ActivityManagerService.trimApplications(ActivityManagerService.java:15294)
D/Process(262): com.android.server.am.ActivityStack.activityIdleInternal(ActivityStack.java:3450)
D/Process(262): com.android.server.am.ActivityManagerService.activityIdle(ActivityManagerService.java:4303)
D/Process(262): android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:362)
D/Process(262): com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:1706)
D/Process(262): android.os.Binder.execTransact(Binder.java:338)
D/Process(262): dalvik.system.NativeStart.run(Native Method)

是否有人知道什么是故意的URI怎么回事?为什么不能工作?而是否有解决办法?

Does someone know what is going on with intent URIs here? Why is it failing to work? And is there a workaround?

谢谢, 西蒙

推荐答案

既然我能在一个HTC个S复制这个问题,我不能在其他ICS / JB设备复制这个问题,我presume,这是在Linkify变通办法的另一项成果是 HTC到位回应苹果主导的诉讼

Since I can replicate this problem on an HTC One S, and I cannot replicate this problem on other ICS/JB devices, I presume that this is another outcome of the Linkify workaround that HTC put in place in response to Apple-led litigation.

和是否有解决办法?

如果你是在控制双方(例如,的WebView 包含的链接,以及应用程序响应意图 URL),您可以手动强制通过 Intent.createChooser(),以及可能的工作。

If you are in control of both sides (e.g., a WebView containing the link, plus the app responding to the intent URL), you could manually force a chooser via Intent.createChooser(), and that might work.

不过,如果你是依靠第三方code(例如,Web浏览器)能够打开你的应用程序,这些宏达设备,我相信你只是搞砸了。

If, however, you are relying upon third-party code (e.g., a Web browser) to be able to open up your app, on these HTC devices, I believe that you are just screwed.

这篇关于标准的意图URI坏了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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