Mehdi Abed
Mehdi Abed

Reputation: 56

Wait a moment befor showing an Intent

If you can help me I will be very grateful. What I want to do is to lunch an intent in the background and show it after 5 seconds.

my code to show Intent is :

Intent intentt = new Intent(Palet_result.this, Rpalet_result.class);
startActivity(intentt);

Thanks a lot.

Upvotes: 0

Views: 131

Answers (1)

Chol
Chol

Reputation: 2117

You can use a handler:

    new Handler().postDelayed(new Runnable(){
        @Override
        public void run() {
              Intent intent = new Intent(Palet_result.this, Rpalet_result.class);
              startActivity(intent);                                                

        }

   }, 5000);

Upvotes: 4

Related Questions