Hello friends, here is simple splash screen code :
public class SplashScreen extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.splash_splashscreen);
new CountDownTimer(3000, 1000)
{
public void onTick(long arg0)
{
}
public void onFinish()
{
Intent i = new Intent(getApplicationContext(), LoginA.class);
startActivity(i);
SplashScreen.this.finish();
}
}.start();
}
}
"splash_splashscreen" is an xml file. splash_splashscreen.xml code is shown below.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/splash_image" >
</RelativeLayout>
No comments:
Post a Comment