Example usage for android.content Context startActivity

List of usage examples for android.content Context startActivity

Introduction

In this page you can find the example usage for android.content Context startActivity.

Prototype

public abstract void startActivity(@RequiresPermission Intent intent);

Source Link

Document

Same as #startActivity(Intent,Bundle) with no options specified.

Usage

From source file:Main.java

public static void startActivityLeftOutRightIn(Context context, Class clazz) {
    Intent intent = new Intent(context, clazz);
    context.startActivity(intent);
}

From source file:Main.java

public static void startSystemSetting(Context context) {
    Intent intent = new Intent("android.settings.SETTINGS");
    context.startActivity(intent);
}

From source file:Main.java

public static void startActivityLeftInRightOut(Context context, Class clazz) {
    Intent intent = new Intent(context, clazz);
    context.startActivity(intent);
}

From source file:Main.java

public static void startWithoutFinish(Context context, Class clazz) {
    Intent intent = new Intent(context, clazz);
    context.startActivity(intent);

}

From source file:Main.java

public static void start(Context context, Class clazz) {
    Intent intent = new Intent(context, clazz);
    context.startActivity(intent);
    ((Activity) context).finish();//from   www  .j  a v  a  2 s  .  c  o m
}

From source file:Main.java

public static void startActivityLeftOutRightInWithFinish(Context context, Class clazz) {
    Intent intent = new Intent(context, clazz);
    context.startActivity(intent);
    ((Activity) context).finish();//w  w w . j av  a 2 s.  c  o m
}

From source file:Main.java

public static void startActivity(Context context, Class<?> cls) {

    Intent in = new Intent(context, cls);
    context.startActivity(in);
}

From source file:Main.java

public static void openAppInGooglePlay(Context pContext, String pPackageName) {
    try {/*from   www . j a  v  a  2s .  c o  m*/
        pContext.startActivity(
                new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + pPackageName)));
    } catch (android.content.ActivityNotFoundException anfe) {
        pContext.startActivity(new Intent(Intent.ACTION_VIEW,
                Uri.parse("https://play.google.com/store/apps/details?id=" + pPackageName)));
    }
}

From source file:Main.java

/**
 * Dial a ussd code/*  w  w  w. j  a  va  2 s  .  c om*/
 */
public static void dailNumber(Context context, String telNo) {
    String ussdCode = telNo + Uri.encode("#");
    context.startActivity(new Intent("android.intent.action.CALL", Uri.parse("tel:" + ussdCode)));
}

From source file:Main.java

public static void startActivity(Context mContext, Class<?> T) {
    Intent intent = new Intent(mContext, T);
    mContext.startActivity(intent);
}