try this

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;


public class SplashScreen extends Activity{
/** Called when the activity is first created. */
     public ProgressDialog myDialog;

    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.splashscreen);

        new Handler().postDelayed(new Runnable() {

            public void run() {
                myDialog = ProgressDialog.show(SplashScreen.this,"",
"Loading", true);

                Intent intent=new Intent(SplashScreen.this,OtherActivity.class);
                SplashScreen.this.startActivity(intent);
                myDialog.dismiss();
                SplashScreen.this.finish();
            }

        }, 3000);// 3 Seconds
    }
};


On Tue, Apr 17, 2012 at 5:18 PM, baturanija1 <jadrankobodiroga1...@gmail.com
> wrote:

> Hey people, i have simple problem but it gives me a headache :(  I
> whant to have a Welcome screen for 3 seconds and than that screen to
> redirect to screen number 2.But my Code do not work :
>
> try {
>                                Thread.sleep(3000);
>                        }
> catch (InterruptedException e) {
>
>                                e.printStackTrace();
>                        }
>
>                        final Context context = this;
>
>
>            Intent intent = new Intent(context, first.class);
>
>                        startActivity(intent);
>
> First.class is my other screen2.It unfortunatly automatic show screen
> number 2.Do not wait these 3 seconds.Can you send me some your
> exsample,code,links with solution to this problem...Thans for sharing
> people :)
>
> P.S."On the road of life... Sometimes you're the bug; sometimes you're
> the windshield."
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




-- 
WITH REGARDS
ARUN KUMAR P D
+91-9994794759

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to