-
Create new Android Project call Android Splash Screen and put your launch image at res/drawable folder.
-
Also create three xml file one for splash screen give name splashscreen.xml in res/layout folder and create one new folder in res folder and give name anim and create two xml file called fade_in.xml and fade_out.xml for animation.
-
Modify Animations xml file as per below code.
fade_in.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<alpha android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="4000"/> //Milliseconds
</set>
fade_out.xml
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true">
<alpha android:fromAlpha="1.0"
android:toAlpha="0.0"
android:duration="4000"/> //Miliseconds
</set>
-
Now modify your main.xml and splashscreen.xml file as per below code
main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:gravity="center"
>
<TextView
android:id="@+id/tv1"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="70dp"
android:textSize="20sp"
android:text="@string/main_screen"
android:textColor="#000000" />
</RelativeLayout>
splashscreen.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:background="@drawable/splash_screen"
android:layout_height="fill_parent"
android:orientation="vertical" >
</RelativeLayout>
-
Now Create one SplashScreen.java file in src folder and modify as below code
SplashScreen.java
package com.idroid.splashscreen;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
public class SplashScreen extends Activity {
private static final int TIME = 4 * 1000;// 4 seconds
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splashscreen);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent = new Intent(SplashScreen.this,
MainActivity.class);
startActivity(intent);
SplashScreen.this.finish();
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
}, TIME);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
}
}, TIME);
}
@Override
public void onBackPressed() {
this.finish();
super.onBackPressed();
}
}
-
Now build and run your project on Simulator you can see the splash screen for 4 seconds.
no deposit bonus forex 2021 - takipçi satın al - takipçi satın al - takipçi satın al - takipcialdim.com/tiktok-takipci-satin-al/ - instagram beğeni satın al - instagram beğeni satın al - google haritalara yer ekleme - btcturk - tiktok izlenme satın al - sms onay - youtube izlenme satın al - google haritalara yer ekleme - no deposit bonus forex 2021 - tiktok jeton hilesi - tiktok beğeni satın al - binance - takipçi satın al - uc satın al - finanspedia.com - sms onay - sms onay - tiktok takipçi satın al - tiktok beğeni satın al - twitter takipçi satın al - trend topic satın al - youtube abone satın al - instagram beğeni satın al - tiktok beğeni satın al - twitter takipçi satın al - trend topic satın al - youtube abone satın al - instagram beğeni satın al - tiktok takipçi satın al - tiktok beğeni satın al - twitter takipçi satın al - trend topic satın al - youtube abone satın al - instagram beğeni satın al - perde modelleri - instagram takipçi satın al - instagram takipçi satın al - cami avizesi - marsbahis
ReplyDeletemmorpg oyunlar
ReplyDeleteınstagram takipci satin al
tiktok jeton hilesi
Tiktok Jeton Hilesi
antalya saç ekimi
referans kimliği nedir
instagram takipçi satın al
metin2 pvp serverlar
İnstagram Takipçi Satin Al
Fon Perde Modelleri
ReplyDeleteSms Onay
mobil ödeme bozdurma
Nft Nasil Alınır
ankara evden eve nakliyat
trafik sigortası
dedektör
Kurma Web Sitesi
aşk romanları