How to implement Android Splash Activity in easy way.
Step By Step Implementation of Android Splash Screen.
1) first we need to create new project in android studio.
2) After Open Mainactivity.xml file.and add imageview in activity.
3) After create new activity (ex.login).
4) Add code in mainactivity,
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// This method will be executed once the timer is over
Intent i = new Intent(MainActivity.this,login.class);
startActivity(i);
finish();
}
}, 5000);5)Run the project.6)your splash screen are successfully added in Your app.========================================================================
Here,
postDelayed() : This function delays the process for a specified time.
Handler() : postDelayed() used with a handler which allows you to send and process Message and Runnable objects associated with a Thread’s MessageQueue. Each handler instance is a single thread.



Comments
Post a Comment