首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >活动URL回调在4.0.3 ICS中不起作用

活动URL回调在4.0.3 ICS中不起作用
EN

Stack Overflow用户
提问于 2012-05-31 09:21:29
回答 4查看 734关注 0票数 16

我在twitter应用程序中使用OAUTH,它会将您发送到应用程序内的twitter页面,然后您在那里登录并被重定向回处理令牌的应用程序。这在Android2.0.x和3.0.x中工作得很好,但是在4.0中,当我试图重定向回我的应用程序时,我得到了“网页不可用”。有人能告诉我这是为什么吗?我的清单文件中有以下内容:

代码语言:javascript
复制
<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="myapp" android:host="myactivity"/>
</intent-filter>

twitter页面被赋予了回调URL,这个URL一直在工作,但现在在android 4.0 ICS中不起作用,有人能帮忙吗?谢谢。

EN

回答 4

Stack Overflow用户

发布于 2013-10-29 16:53:56

确保你的CALLBACK_URL是

代码语言:javascript
复制
myapp://myactivity
票数 0
EN

Stack Overflow用户

发布于 2014-04-22 17:07:20

我用了这个,它解决了我的问题:

代码语言:javascript
复制
<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="x-oauthflow-twitter" android:host="callback" />
</intent-filter>
票数 0
EN

Stack Overflow用户

发布于 2014-04-29 22:15:09

代码语言:javascript
复制
   <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:launchMode="singleTop" >

<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="t4jsample"
            android:scheme="oauth" />

    </intent-filter> 

这是我在应用程序中用来集成twitter的代码。这对我来说很有效,我正在使用HTC desire V和ICS 4.0.3。

我参考了这篇教程来进行集成。http://www.androidhive.info/2012/09/android-twitter-oauth-connect-tutorial/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10826327

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档