0

我试图启动浏览器在 twitter 中进行授权,并希望它返回到我的应用程序。我在 AndroidManifest.xml 中将意图过滤器声明为:

<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="appfortwitter" 
          android:host="com.pfs.safecrackerplus-callback" />                
</intent-filter>            

在应用程序活动中,我定义了方法

@Override
protected void onNewIntent(Intent intent) 
{
 ...
}

授权后,我的应用程序再次启动,但调用了 onCreate 方法而不是 onNewIntent。

我做错了什么?

4

1 回答 1

0

为什么您使用 Web 浏览器而不是 twitter 3rd party api for Android 进行身份验证。身份验证完成后,您永远不会返回您的活动。因为它永远不会通知您身份验证是否完成。

最后,您应该使用 twitter api for android 来代替它。

于 2012-10-18T17:03:00.517 回答