Example usage for android.provider Settings ACTION_APPLICATION_DETAILS_SETTINGS

List of usage examples for android.provider Settings ACTION_APPLICATION_DETAILS_SETTINGS

Introduction

In this page you can find the example usage for android.provider Settings ACTION_APPLICATION_DETAILS_SETTINGS.

Prototype

String ACTION_APPLICATION_DETAILS_SETTINGS

To view the source code for android.provider Settings ACTION_APPLICATION_DETAILS_SETTINGS.

Click Source Link

Document

Activity Action: Show screen of details about a particular application.

Usage

From source file:Main.java

public static void openApplicationSettings(Activity activity) {
    Intent intent = new Intent();
    intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    Uri uri = Uri.fromParts("package", activity.getPackageName(), null);
    intent.setData(uri);//from  w w  w. j  a v  a2s.c o m
    activity.startActivity(intent);
}

From source file:Main.java

public static void openMyAppInfo(Context mContext) {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    Uri uri = Uri.fromParts(SCHEME, mContext.getPackageName(), null);
    intent.setData(uri);/* w  w w  .  j a  v  a  2 s. com*/
    mContext.startActivity(intent);
}

From source file:Main.java

public static void openAppDetailSetting(Context context, String packageName) {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    Uri uri = Uri.fromParts("package", packageName, null);
    intent.setData(uri);/*  w  w  w.  j a  v  a2 s .c  o m*/
    context.startActivity(intent);
}

From source file:Main.java

public static boolean settings(Context context, PackageInfo packageInfo) {
    Intent intent = new Intent();
    intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.parse("package:" + packageInfo.packageName));
    context.startActivity(intent);//from w ww. j a v a2s  .co m
    return true;
}

From source file:Main.java

public static void openAppSettings(Context context) {
    Intent myAppSettings = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
            Uri.parse("package:" + context.getPackageName()));
    myAppSettings.addCategory(Intent.CATEGORY_DEFAULT);
    myAppSettings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(myAppSettings);
}

From source file:Main.java

public static void startSettingIntent(Context context, Intent intent) {
    try {/*from ww  w  . java2  s . c  o m*/
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    } catch (Exception e) {
        intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
        intent.setData(Uri.parse("package:" + context.getPackageName()));
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }
}

From source file:Main.java

public static void goToInstalledAppDetails(Context context, String packageName) {
    Intent intent = new Intent();
    int sdkVersion = Build.VERSION.SDK_INT;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
        intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
        intent.setData(Uri.fromParts("package", packageName, null));
    } else {/*from   w ww.ja v a 2 s.c  o  m*/
        intent.setAction(Intent.ACTION_VIEW);
        intent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails");
        intent.putExtra(
                (sdkVersion == Build.VERSION_CODES.FROYO ? "pkg" : "com.android.settings.ApplicationPkgName"),
                packageName);
    }
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(intent);
}

From source file:Main.java

/**
 * Helper method where either the application will open the {@link Settings#ACTION_APPLICATION_DETAILS_SETTINGS}
 * or {@link Settings#ACTION_MANAGE_APPLICATIONS_SETTINGS}
 *
 * @param context//w w  w. j  a  v a  2 s.co m
 * @return
 */
public static Intent getLaunchSettingsIntent(Context context) {
    Intent intent;
    try {
        // Direct the user to the application detail page where they can change the permissions.
        intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
        intent.addCategory(Intent.CATEGORY_DEFAULT);
        intent.setData(Uri.parse("package:" + context.getPackageName()));
    } catch (ActivityNotFoundException e) {
        // Fails take then to the all applications screen.
        intent = new Intent(Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
        intent.addCategory(Intent.CATEGORY_DEFAULT);
    }
    return intent;
}

From source file:Main.java

/**
 * Launch Application Setting to grant permission.
 *///from  w  ww  .  jav a 2 s  .c om
public static void launchPermissionSettings(Activity activity) {
    Intent intent = new Intent();
    intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.fromParts("package", activity.getPackageName(), null));
    activity.startActivity(intent);
}

From source file:Main.java

@SuppressLint("InlinedApi")
public static void openSys(Context context, String packageName) {
    Intent intent = new Intent();
    final int apiLevel = Build.VERSION.SDK_INT;
    if (apiLevel >= 9) {
        intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
        intent.setData(Uri.fromParts("package", packageName, null));
    } else {/*from  w  w  w  .j ava2 s.c o m*/
        intent.setAction(Intent.ACTION_VIEW);
        intent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails");
        String appPkgName = (apiLevel == 8 ? "pkg" : "com.android.settings.ApplicationPkgName");
        intent.putExtra(appPkgName, packageName);
    }
    context.startActivity(intent);
}