Splash Screen in Android
Hello Friends in this article i am gone to share how you can create Splash Screen in Android with you.. | Android SplashScreen
Splash Screen in Android
Also Learn: Add Two Number Program app in Android Studio
Create Project : Splash
Step 1) first copy your logo pic drabbles folder.
Step 2) open java folder on the com,example.splash
right click on it , create new empty activity..
Step 3) little change in Manifest file…
In this code i moved launcher code SplashActivity
Android: Splash Screen
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.splash">
<
application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.Splash">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name=”android.intent.category.LAUNCHER” />
</intent-filter>
</
activity>
<activity android:name=".MainActivity">
</
activity>
<
meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
</application>
</
manifest>
ย
ย
Activity_Splash.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:layout_centerInParent="false"
android:layout_centerHorizontal="false"
android:layout_centerVertical="false"
tools:context=".SplashActivity">
<ImageView
android:id=”@+id/imageView”
android:layout_width=”203dp”
android:layout_height=”207dp”
android:layout_centerInParent=”true”
app:srcCompat=”@drawable/logos”
tools:srcCompat=”@drawable/logos” />
<TextView
android:id=”@+id/textView”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_alignParentBottom=”true”
android:layout_centerInParent=”true”
android:layout_marginBottom=”136dp”
android:fontFamily=”@font/artifika”
android:text=”Animi World”
android:textSize=”36sp”
android:textStyle=”bold” />
</RelativeLayout>
SplashActivity.java
ย
package com.example.splash;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
getSupportActionBar().hide();
Thread thread = new Thread(){
public void run(){
try{
sleep(3500);
}
catch(InterruptedException e){
e.printStackTrace();
} finally {
Intent openMain = new Intent(SplashActivity.this, MainActivity.class);
startActivity(openMain);
finish();
}
}
};
thread.start();
}
}
your article help me alot