2
是否可以在Splash屏幕後打開FragmentActivity?Android Splash Screen to FragmentActivity
我想打開FragmentActivity /我得到下面的片段後,閃屏,但錯誤:
Unable to find explicit activity class {com.**********.MainActivity}; have you declared this activity in your AndroidManifest.xml?
我閃屏:
public class SplashScreen extends Activity {
private final int SPLASH_DISPLAY_LENGTH = 3000;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.activity_splash);
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
Intent mainIntent = new Intent(SplashScreen.this,Juli.class);
SplashScreen.this.startActivity(mainIntent);
SplashScreen.this.finish();
}
}, SPLASH_DISPLAY_LENGTH);
}
}
清單:
<activity
android:name="com.test.tab.SplashScreen"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
ty working我明白了:) –
5分鐘內接受不了 –
您想使用的每個活動都必須在manifest中聲明 - http://developer.android.com/guide/topics/manifest/activity-element.html –