Example usage for android.app Activity startActivity

List of usage examples for android.app Activity startActivity

Introduction

In this page you can find the example usage for android.app Activity startActivity.

Prototype

@Override
public void startActivity(Intent intent) 

Source Link

Document

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

Usage

From source file:Main.java

public static void callPhone(String number, Activity act) {
    Intent callIntent = new Intent(Intent.ACTION_CALL);
    callIntent.setData(Uri.parse("tel:" + number));
    act.startActivity(callIntent);
}

From source file:Main.java

public static void rateTheApp(Activity activity) {
    Intent goToMarket = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.giggs.apps.chaos"));
    activity.startActivity(goToMarket);
}

From source file:Main.java

public static void startActivity(Activity activity, Class classActivity) {
    Intent intent = new Intent();
    intent.setClass(activity, classActivity);
    activity.startActivity(intent);
}

From source file:Main.java

public static void makePhoneCall(Activity activity, String phone) {
    Uri uri = Uri.parse("tel:" + phone);
    Intent it = new Intent(Intent.ACTION_DIAL, uri);
    activity.startActivity(it);
}

From source file:Main.java

public static void startActivityWithIntent(final Activity activity, final Intent intent) {
    activity.runOnUiThread(new Runnable() {
        public void run() {
            activity.startActivity(intent);
        }//from  w  w  w . j  a va  2  s.  com
    });
}

From source file:com.mintplex.oeffioptimizer.AbstractActivity.java

public static void start(Activity ctx, Class<?> clazz, long id) {
    Intent i = new Intent(ctx, clazz);
    i.putExtra("id", id);
    ctx.startActivity(i);
}

From source file:Main.java

public static void startActivityForData(Activity activity, Class<?> cls, String data) {
    Intent intent = new Intent(activity, cls);
    intent.putExtra("data", data);
    activity.startActivity(intent);
}

From source file:Main.java

public static void callPhone(Activity activity, String phoneNumber) {
    Intent phoneIntent = new Intent("android.intent.action.CALL", Uri.parse("tel:" + phoneNumber));
    activity.startActivity(phoneIntent);
}

From source file:Main.java

public static void callTel(Activity activity, String number) {
    Uri uri = Uri.parse("tel:" + number);
    Intent intent = new Intent(Intent.ACTION_CALL, uri);
    activity.startActivity(intent);
}

From source file:Main.java

public static void redirectWithClearTop(Activity activity, Class<?> cls) {
    Intent intent = new Intent(activity, cls);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    activity.startActivity(intent);
    activity.overridePendingTransition(0, 0);
}