Splash Timer for Activity - Android Activity

Android examples for Activity:Activity Action

Description

Splash Timer for Activity

Demo Code


//package com.java2s;
import android.app.Activity;

import android.os.Handler;

import android.os.Handler;
import android.content.Intent;

public class Main {
    public static void SplashTimer(final Activity act, int inMilliSecs,
            final Class whereTo) {
        new Handler().postDelayed(new Runnable() {
            @Override//from  ww w. j  av a  2s. c  om
            public void run() {
                Intent i = new Intent(act, whereTo);
                act.startActivity(i);
                act.overridePendingTransition(android.R.anim.fade_in,
                        android.R.anim.fade_out);
                act.finish();
            }
        }, inMilliSecs);
    }
}

Related Tutorials