Add splash screen in your Android project:
Everybody wants a user to make his application beautiful and attractive. Developers then use their built-in splash screen.
You will see many applications where you have to use splash screens neatly, using splash screens, most of the game apps can be seen. Some people use splash screens to display their app or company’s logo for a few seconds.
Most Android apps the developers are using the Android splash screen before launching the App Activity. The popular Android apps like Skype, Facebook, Adobe Reader and more popular Apps using the splash screen to display their logo.
An Android splash screen is used to display a logo or brand for an app. In this tutorial talking about the implementation of the Android Splash Screen in your Android Apps.
This tutorial will show you to add splash screen in your Android application project. Implement splash screen in your Android project follows the example codes.
XML Code:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".splash_screen" android:background="@drawable/splash"> </RelativeLayout>
Java Code:
public class splash_screen extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash_screen); new Handler().postDelayed(new Runnable() { @Override public void run() { Intent intent=new Intent(splash_screen.this,MainActivity.class); startActivity(intent); finish(); } },2000); } }