start One Activity by Intent - Android android.app

Android examples for android.app:Activity Start

Description

start One Activity by Intent

Demo Code

import android.app.Activity;
import android.content.Intent;

public class Main {

  public static void startOneActivity(Activity mActivity, Class cls) {
    Intent intent = new Intent(mActivity, cls);
    mActivity.startActivity(intent);/*  w w  w  .j av a 2s .c om*/
    mActivity.finish();
  }

}

Related Tutorials