Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.otak3.goo;
- import android.app.Activity;
- import android.content.Intent;
- import android.os.Bundle;
- public class SplashScreenActivity extends Activity {
- /** Called when the activity is first created. */
- private long ms = 0;
- private long splashTime = 5000;
- private boolean splashActive = true;
- private boolean splashPause = false;
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main1);
- Thread th = new Thread(){
- public void run(){
- try { while (splashActive && ms < splashTime) {
- if (!splashPause){ ms = ms +100; } sleep(100); }
- }
- catch (Exception e) {
- } finally {
- Intent i = new Intent(SplashScreenActivity.this,Splash2.class);
- startActivity(i); } } };
- th.start();
- this.finish(); /*ini koding supaya activitynya finish() setelah manggil splash2*/
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment