run Activity by activity id - Android android.app

Android examples for android.app:Activity Navigation

Description

run Activity by activity id

Demo Code

import android.app.Activity;
import android.view.Window;
import android.view.WindowManager;

public class Main{

    public static void runActivity(Activity activity, int activityId) {
        activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
        activity.getWindow().setFlags(/*  w w w .  j ava  2  s  .  co  m*/
                WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        activity.setContentView(activityId);

    }

}

Related Tutorials