Pada halaman main.java ketikan coding di bawah ini :
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
LOADINGSPLASH();}
public void LOADINGSPLASH(){
final ProgressDialog myProgressDialog = ProgressDialog.show(main.this, "Loading", "Mohon Tunggu...", true);
new Thread() {
public void run() {
try{Thread.sleep(5000);}
catch (Exception e) {}
Intent i = new Intent(main.this, login.class);
myProgressDialog.dismiss();
main.this.finish();
startActivity(i);
} }.start();
}
public void setSplash(){
new Thread() {
public void run() {
try{Thread.sleep(5000);}
catch (Exception e) {}
Intent i = new Intent(main.this, menu.class);
main.this.finish();
startActivity(i);
} }.start();
}}
Silakan agan- agan coba semoga bermanfaat.Sumber: http://manifestandroid.blogspot.co.id/2012/10/membuat-loading-splash-pada-android.html
Post A Comment:
0 comments: