tutorial make simple splash screen in android studio
Splash Screen
In our country Indonesia is still a little interested to become Developer Indonesia,
in comparison with neighboring countries like India which has Developer-developer more than 30,000 million developers while in Indonesia is still about 1,000 million developers. so, we who are interested to learn to be a developer should be eager to learn because our chances are still great to be
Developer.
At this meeting I will teach you how to make splashscreen with medah on android studio before we start to make splashscreen we should pray first so easy to make and certainly not error.
Well just start we start to make it.
- Open Android Studio App on your Computer
- Create a new Project, click File> new> new Project with the name SplashScreen then click next
- Then click next, then next, then next
- Locate the image on your computer and copy it, then paste it in the drawable folder with the background name and click ok
- Go to Activity activity_main.xml and type the script below
<?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="@drawable/bgg" tools:context="com.dapurpl.asmaulhusna.splash"> <ProgressBar android:id="@+id/loading" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="43dp" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" /> <ImageView android:layout_marginBottom="30dp" android:id="@+id/imageView3" android:layout_width="130dp" android:layout_height="130dp" android:layout_above="@+id/loading" android:layout_centerHorizontal="true" app:srcCompat="@drawable/background" /> </RelativeLayout>
- Go to Activity.java and type the script below
Thread splash=new Thread(){ @Override public void run() { try { sleep(3000); Intent intent = new Intent(getApplicationContext(),MainActivity.class); startActivity(intent); finish(); } catch (InterruptedException e) { e.printStackTrace(); } } }; splash.start();Thread splash=new Thread(){@Override public void run() { try { sleep(3000); Intent intent = new Intent(getApplicationContext(),MainActivity.class); startActivity(intent); finish(); } catch (InterruptedException e) { e.printStackTrace(); } } }; splash.start();
- Breathe in slowly then remove the finish.
When we want to make something make sure what we make is done.
God will not help us if we do not mean what we want.
Good luck good luck, see you in other posts yes ..
Thanks for your visit do not forget comment yes ...
Comments