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 openApp(Context pContext, String pPackageName) {
    Intent launchIntent = pContext.getPackageManager().getLaunchIntentForPackage(pPackageName);
    pContext.startActivity(launchIntent);
}

From source file:Main.java

public static void sendIntent(Context context, Class classes) {
    Intent intent = new Intent();
    intent.setClass(context, classes);//  w  ww  .  j av a2s.c om
    context.startActivity(intent);
}

From source file:Main.java

public static void jumpToActivity(Context context, Class<? extends Activity> targetClass) {
    Intent datatIntent = new Intent(context, targetClass);
    context.startActivity(datatIntent);
}

From source file:Main.java

public static void showMarketProductBuyPackage(Context context, String pack) {
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("market://details?id=" + pack));
    context.startActivity(intent);
}

From source file:Main.java

/**
 * use for sending mail to any id// w  w  w  . j  a v a  2s  .co m
 *
 * @param mContext context
 * @param mailID   email id of whom to send mail
 */
public static void sendMail(Context mContext, String mailID) {
    Uri uri = Uri.parse("mailto:" + mailID);
    Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
    mContext.startActivity(intent);
}

From source file:Main.java

public static void unInstallApp(Context context, String packageName) {
    Uri uri = Uri.parse("package:" + packageName);
    Intent intent = new Intent(Intent.ACTION_DELETE, uri);
    context.startActivity(intent);
}

From source file:Main.java

public static void callBrowser(Context context, String uri) {
    Intent intent = new Intent();
    intent.setData(Uri.parse(uri));/*from w  w  w . ja  v  a 2 s. c  o m*/
    intent.setAction(Intent.ACTION_VIEW);
    context.startActivity(intent);
}

From source file:Main.java

public static void startUninstallApk(Context context, String packageName) {
    Uri uri = Uri.parse("package:" + packageName);
    Intent intent = new Intent(Intent.ACTION_DELETE, uri);
    context.startActivity(intent);
}

From source file:Main.java

public static void uninstallApk(Context context, String packageName) {
    Uri uri = Uri.parse("package:" + packageName);
    Intent intent = new Intent(Intent.ACTION_DELETE, uri);
    context.startActivity(intent);
}

From source file:Main.java

public static void openBrowser(Context context, String url) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.setData(Uri.parse(url));/*from w w w.j  a  va  2s  .  c  o  m*/
    context.startActivity(intent);
}