Java tutorial
//package com.java2s; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.AsyncTask; public class Main { public static void jumpPostToNewActivity(final Context context, final Class<? extends Activity> targetClass, final int second) { (new AsyncTask<String, Integer, Boolean>() { protected Boolean doInBackground(String... params) { try { Thread.sleep((long) (second * 1000)); } catch (Exception var3) { ; } return null; } protected void onPostExecute(Boolean result) { super.onPostExecute(result); Intent datatIntent = new Intent(context, targetClass); datatIntent.setFlags(268435456); context.startActivity(datatIntent); } }).execute(new String[] { "" }); } public static void jumpPostToNewActivity(final Context context, final Class<? extends Activity> targetClass, final int second, final String... datas) { (new AsyncTask<String, Integer, Boolean>() { protected Boolean doInBackground(String... params) { try { Thread.sleep((long) (second * 1000)); } catch (Exception var3) { ; } return null; } protected void onPostExecute(Boolean result) { super.onPostExecute(result); Intent datatIntent = new Intent(context, targetClass); datatIntent.setFlags(268435456); if (datas != null) { for (int i = 0; i < datas.length; ++i) { datatIntent.putExtra("data" + i, datas[i]); } } context.startActivity(datatIntent); } }).execute(new String[] { "" }); } }