我在twitter应用程序中使用OAUTH,它会将您发送到应用程序内的twitter页面,然后您在那里登录并被重定向回处理令牌的应用程序。这在Android2.0.x和3.0.x中工作得很好,但是在4.0中,当我试图重定向回我的应用程序时,我得到了“网页不可用”。有人能告诉我这是为什么吗?我的清单文件中有以下内容:
<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中不起作用,有人能帮忙吗?谢谢。
发布于 2013-10-29 16:53:56
确保你的CALLBACK_URL是
myapp://myactivity
发布于 2014-04-22 17:07:20
我用了这个,它解决了我的问题:
<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>
发布于 2014-04-29 22:15:09
<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/
https://stackoverflow.com/questions/10826327
复制相似问题