- Create A Activity Name Any Suppose SplashActivity And SplashActivity.java File Display A SplashActivity .xml File For 5 Second Or More Then Move To Mainactivity File By Android Intent Your SplashActivity.java IS Like This way.
public class SplashActivity extends Activity {
Handler handler;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splashfile);
handler=new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent=new Intent(SplashActivity.this,MainActivity.class);
startActivity(intent);
finish();
}
},3000);
}
}
2. Design Your Splashactivity.xml As Your Requirement .
3. Set SplashActivity As Luncher Activity . Like Below Way .
<activity android:name="abhiandroid.com.splashscreen.SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="abhiandroid.com.splashscreen.MainActivity"/>
If You Don’t Know How To Set Luncher Activity Please See This Post . Set Specific Activity As Launcher Activity In Android Manifest File