Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.util.Timer;
import java.util.TimerTask;

import android.content.Context;
import android.content.Intent;

public class Main {

    public static void delayToActivity(final Context context, final Class<?> cls, long delay) {
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {

            @Override
            public void run() {
                context.startActivity(new Intent(context, cls));
            }
        }, delay);
    }
}