Java tutorial
//package com.java2s; //License from project: Apache License import android.app.Activity; import android.content.Intent; import android.support.annotation.NonNull; public class Main { private static Activity mActivity; public static void startAct(@NonNull Class cls) { mActivity.startActivity(new Intent(mActivity, cls)); } public static void startAct(@NonNull Class cls, @NonNull Intent intent) { intent.setClass(mActivity, cls); mActivity.startActivity(intent); } }