Many popular Android Apps such as Skype, Facebook, Adobe Reader, 500px,
Dropbox etc., uses splash screen to display their logo. Most Android
Apps uses Android Splash Screen before launching application Activity.
Android splash screen is used to display a logo or brand for an app. In
this article we are going to discuss about implementing an Android
Splash Screen in a simple manner.
Create new activity, Select it as blank activity. Name it as Second activity
Open SplashScreen.java
- Click on File > New Project.
- Next, define Application Name and Minimum SDK and hit Next
- Select Blank Activity and Hit Next.
- Activity name as SplashScreen
- Hit Finish
Create new activity, Select it as blank activity. Name it as Second activity
Open SplashScreen.java
package com.example.test; import android.app.Activity; import android.content.Intent; import android.os.Bundle; public class SplashScreen extends Activity { private Intent myintent; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splashscreen); myintent = new Intent(this, Secondactivity.class);new Thread(new Runnable() { public void run() { try { Thread.sleep(6000); } catch (InterruptedException e) { e.printStackTrace(); } startActivity(myintent); finish(); } }).start();} }
you can design your splashscreen in splashscreen.xml
When opening app it shows splash screen for 6 seconds,
after that opens second activity.
Comments
Post a Comment