1.Create Empty activity in package.
2.Copy a logo into drawable.
3.New activity xml;.
<?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"
android:background="@color/white"
android:gravity="center"
tools:context=".New_activity">
<ImageView
android:layout_width="120dp"
android:layout_height="120dp"
android:id="@+id/logo"
android:src="@drawable/logo"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
4.New_activity java;.
public class splashscreen extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splashscreen);
Thread thread = new Thread(){
public void run(){
try {
sleep(1000);
}catch (InterruptedException e){
e.printStackTrace();
}finally {
startActivity(new Intent(splashscreen.this, MainActivity.class));
finish();
}
}
};
thread.start();
}
}
5.AndroidManifes xml, move intent;.
<activity android:name=".New_activity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>