SplashScreen是我的加载屏幕,当加载完成时,我创建一个Intent来调用我的MainActivity。 为了验证它我创建了一个Intent for Twitter登录(浏览器),登录工作正常但是当Intent自动关闭时,我没有被重定向到我的MainActivity。生成另一个活动,为什么?我认为我的清单有问题:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.android.ikgflipper.SplashScreen"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.android.ikgflipper.MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<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="oauth" android:host="MainActivity"/>
</intent-filter>
</activity>
</application>
我的意图声明:
public class loginTwitter extends AsyncTask<Void, Void, String> {
@Override
protected String doInBackground(Void... params) {
twitter = new TwitterFactory().getInstance();
try {
twitter.setOAuthConsumer(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET);
requestToken = twitter.getOAuthRequestToken(TWITTER_CALLBACK_URL);
} catch(Exception e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(String s) {
startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse(requestToken.getAuthenticationURL())));
}
}
提前谢谢。