gpt4 book ai didi

android - 找不到处理 Intent twitter android 的 Activity

转载 作者:行者123 更新时间:2023-11-30 03:56:17 26 4
gpt4 key购买 nike

我正在尝试按照代码在我的应用程序中使用 Twitter,但它没有提供任何 Activity 来处理 OAuthRequestTokenTask 类中的 Intent

我的代码是

@Override
protected Void doInBackground(Void... params)
{

try {
Log.i(TAG, "Retrieving request token from Google servers");
final String url = provider.retrieveRequestToken(consumer, Constants.CALLBACK_URL);
Log.i(TAG, "Popping a browser with the authorize URL : " + url);
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)).setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_FROM_BACKGROUND);
Log.i(TAG, "before start Context= " + context.toString());
context.startActivity(intent);
Log.i(TAG, "after start Context= " + context.toString());
} catch (Exception e) {
Log.e(TAG, "Error during OAUth retrieve request token", e);
}

return null;
}

它在启动 Activity 时出错。当我使用 log.i 跟踪上下文时,它还会打印正确的一个(PrepareRequestTokenActivity)。

我的 list 是

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.supra.saiapp"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity android:name="PrepareRequestTokenActivity" android:launchMode="singleTask">
<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>
</activity>

<activity android:name="RegisterActivity"></activity>
<activity android:name="ContinueActivity"></activity>
<activity android:name="TabActivity"></activity>
<activity android:name="TabGroupActivity"></activity>
<activity android:name="TabGroup1Activity"></activity>
<activity android:name="TabGroup2Activity"></activity>
<activity android:name="TabGroup3Activity"></activity>
<activity android:name="TabGroup4Activity"></activity>
<activity android:name="TabGroup5Activity"></activity>
<activity android:name="AboutusActivity"></activity>
<activity android:name="PictureGalleryActivity"></activity>
<activity android:name="FullImageActivity"></activity>
<activity android:name="StoriesListActivity"></activity>
<activity android:name="StoryActivity"></activity>
<activity android:name="FavoriteActivity"></activity>
<activity android:name="MyAccountActivity"></activity>
<activity android:name="ShareOnFacebook"></activity>




</application>

错误是

android.content.ActivityNotFoundException: No Activity found to handle Intent {      act=android.intent.action.VIEW dat= https://api.twitter.com/oauth/authorize?oauth_token=7IeCQcKtUWXsP9IH6ftseF8HAGnA5IDRp0WcZqxqM flg=0x60000004 }

请帮忙...

最佳答案

将此演示用于 Twitter 集成...

https://github.com/lorensiuswlt/AndroidTwitter

关于android - 找不到处理 Intent twitter android 的 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13302878/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com