Example usage for android.content Intent CATEGORY_DEFAULT

List of usage examples for android.content Intent CATEGORY_DEFAULT

Introduction

In this page you can find the example usage for android.content Intent CATEGORY_DEFAULT.

Prototype

String CATEGORY_DEFAULT

To view the source code for android.content Intent CATEGORY_DEFAULT.

Click Source Link

Document

Set if the activity should be an option for the default action (center press) to perform on a piece of data.

Usage

From source file:Main.java

public static Intent toRootPermission() {
    Intent intent = new Intent();
    intent.setAction("miui.intent.action.ROOT_MANAGER");
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    return intent;
}

From source file:Main.java

public static Intent toAutoStartPermission() {
    Intent intent = new Intent();
    intent.setAction("miui.intent.action.OP_AUTO_START");
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    return intent;
}

From source file:Main.java

public static void sendBroadCast(Context context, String action, String key, String value) {
    Intent intent = new Intent();
    intent.setAction(action);//from w  ww. j  a v a2 s . c  o m
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    intent.putExtra(key, value);
    context.sendBroadcast(intent);
}

From source file:Main.java

public static void openAppDetails(Context context, String pkgname) {
    Intent i = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    i.addCategory(Intent.CATEGORY_DEFAULT);
    Uri data = Uri.parse("package:" + pkgname);
    i.setData(data);/*  w  ww  .  j av a 2s  . com*/
    context.startActivity(i);
}

From source file:Main.java

public static void startShareIntentActivity(Activity activity, String text) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_SEND);
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    intent.setType("text/plain");
    intent.putExtra(Intent.EXTRA_TEXT, text);
    activity.startActivity(intent);/*from  w  w w.  ja v  a  2 s.c o  m*/
}

From source file:Main.java

public static void installApp(Context mContext, String path) {
    Intent i = new Intent();
    i.setAction(Intent.ACTION_VIEW);/*  w w w  . j av a 2  s  .com*/
    i.addCategory(Intent.CATEGORY_DEFAULT);
    i.setDataAndType(Uri.fromFile(new File(path)), "application/vnd.android.package-archive");
    mContext.startActivity(i);
}

From source file:Main.java

/**
 * Install apk/*  w  w w.  j a v  a2 s  . c o m*/
 */
public static void installApk(Context context, File file) {
    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
}

From source file:Main.java

/**
 * Launch an intent in the CATEGORY_DEFAULT.
 * @param activity The activity to launch from
 * @param intent The intent to launch//  w w w .j a  va 2 s.c  om
 */
public static void launchDefaultIntent(final Activity activity, final Intent intent) {
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    activity.startActivity(intent);
}

From source file:Main.java

public static void showUCBrowser(Context context, String visitUrl) {
    Intent intent = new Intent();
    intent.setClassName("com.uc.browser", "com.uc.browser.ActivityUpdate");
    intent.setAction(Intent.ACTION_VIEW);
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    intent.setData(Uri.parse(visitUrl));
    context.startActivity(intent);/*from   w  w  w.j  a va 2 s  . c o  m*/
}

From source file:Main.java

public static void showQQBrowser(Context context, String visitUrl) {
    Intent intent = new Intent();
    intent.setClassName("com.tencent.mtt", "com.tencent.mtt.MainActivity");
    intent.setAction(Intent.ACTION_VIEW);
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    intent.setData(Uri.parse(visitUrl));
    context.startActivity(intent);/*from  w ww.  j a v a 2 s.  c om*/
}