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 CallPhone(Context context, String phone) {
    Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + phone));
    context.startActivity(intent);
}

From source file:Main.java

public static void call(Context ctx, String number) {
    Intent callIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
    ctx.startActivity(callIntent);
}

From source file:Main.java

public static void startActivity(Context ctx, Intent intent) {
    intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
    ctx.startActivity(intent);
}

From source file:Main.java

public static void jump2Browser(Context context, String url) {
    Intent viewIntent = new Intent("android.intent.action.VIEW", Uri.parse(url));
    context.startActivity(viewIntent);
}

From source file:Main.java

public static void call(Context context, String number) {
    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
    context.startActivity(intent);
}

From source file:Main.java

public static void jump(Context context, Class clazz) {
    Intent intent = new Intent();
    intent.setClass(context, clazz);/*from www  .  ja  v a2 s.  c  om*/
    context.startActivity(intent);
}

From source file:Main.java

public static void onCallPhone(Context context, String mobile) {
    Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + mobile));
    context.startActivity(intent);
}

From source file:Main.java

public static void to(Context context, Class<?> toClass) {
    Intent intent = new Intent();
    intent.setClass(context, toClass);/*from  ww  w .  jav a 2s. c  om*/
    context.startActivity(intent);
}

From source file:Main.java

/**
 * Go to nextActivity without extra data
 * *//*from w ww  .j a va  2  s .co m*/
public static void toNextActivity(Context context, Class<?> nextActivityClass) {

    Intent intent = new Intent(context, nextActivityClass);

    context.startActivity(intent);
}

From source file:Main.java

public static void jumpActivityDefault(Context context, Class<? extends Activity> activityClass) {
    Intent intent = new Intent(context, activityClass);
    context.startActivity(intent);
}