本文整理汇总了Java中android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS属性的典型用法代码示例。如果您正苦于以下问题:Java Settings.ACTION_APPLICATION_DETAILS_SETTINGS属性的具体用法?Java Settings.ACTION_APPLICATION_DETAILS_SETTINGS怎么用?Java Settings.ACTION_APPLICATION_DETAILS_SETTINGS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.provider.Settings
的用法示例。
在下文中一共展示了Settings.ACTION_APPLICATION_DETAILS_SETTINGS属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClick
@Override
public void onClick(View view) {
switch (currentState) {
case -4:
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", context.getPackageName(), null);
intent.setData(uri);
context.startActivity(intent);
break;
case -3:
break;
case -2:
break;
case -1:
break;
case 0:
break;
case 1:
break;
case 2:
break;
default:
break;
}
}
示例2: getAppInfoIntent
/**
* Returns an Intent to show the App Info page for the current app.
*/
private Intent getAppInfoIntent(Context context) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(
new Uri.Builder().scheme("package").opaquePart(context.getPackageName()).build());
return intent;
}
示例3: showAppDetailsForProfile
public void showAppDetailsForProfile(ComponentName component, UserHandleCompat user) {
String packageName = component.getPackageName();
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", packageName, null));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK |
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
mContext.startActivity(intent, null);
}
示例4: startAppSettings
/**
* 启动应用的设置
*
* @since 2.5.0
*
*/
private void startAppSettings() {
Intent intent = new Intent(
Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.parse("package:" + getPackageName()));
startActivity(intent);
}
示例5: goToAppSettings
public static void goToAppSettings(Activity activity) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", activity.getPackageName(), null));
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
activity.startActivity(intent);
}
示例6: goToSettings
private void goToSettings() {
Intent myAppSettings = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.parse("package:" + getPackageName()));
myAppSettings.addCategory(Intent.CATEGORY_DEFAULT);
myAppSettings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivityForResult(myAppSettings, REQUEST_APP_SETTINGS);
}
示例7: openAppDetailsSettings
/**
* 打开设置
*
* @param context 上下文
* @param packageName 包名
*/
public static void openAppDetailsSettings(Context context, final String packageName) {
if (StringUtil.isSpace(packageName)) return;
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.parse("package:" + packageName));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
示例8: startActivity
private boolean startActivity(int id, String packageName) {
String action;
if (id == R.string.app_info) {
action = Settings.ACTION_APPLICATION_DETAILS_SETTINGS;
} else if (id == R.string.uninstall) {
action = Intent.ACTION_DELETE;
} else {
return false;
}
mActivity.startActivity(new Intent(action, Uri.fromParts("package", packageName, null)));
return true;
}
示例9: openSettings
public static void openSettings(Context context) {
//步骤:应用信息->权限->'勾选对应权限'
Uri uri = Uri.parse("package:" + context.getPackageName());
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, uri);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
}
示例10: handlePermissions
private void handlePermissions() {
SharedPreferences permissionStatus = this.getSharedPreferences("permissionStatus",
this.MODE_PRIVATE);
if (ActivityCompat.checkSelfPermission(this, permissionsRequired[0]) != PackageManager
.PERMISSION_GRANTED
|| ActivityCompat.checkSelfPermission(this, permissionsRequired[1]) !=
PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale(this, permissionsRequired[0])
|| ActivityCompat.shouldShowRequestPermissionRationale(this,
permissionsRequired[1])) {
//true means user not allowed the permission but may we can convince him/her
//false have two meaning: 1-user not asked for permission 2-user denied and check
// 'Don't Ask Again'
//so we had to Show Information about why you need the permission
ActivityCompat.requestPermissions(this, permissionsRequired,
PERMISSION_CALLBACK_CONSTANT);
} else if (permissionStatus.getBoolean(permissionsRequired[0], false)) {
//Previously Permission Request was cancelled with 'Dont Ask Again',
// Redirect to Settings after showing Information about why you need the permission
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", this.getPackageName(), null);
intent.setData(uri);
this.startActivityForResult(intent, REQUEST_PERMISSION_SETTING);
Toast.makeText(this, "Go to Permissions to Grant Sms", Toast.LENGTH_LONG)
.show();
} else {
//just request the permission
ActivityCompat.requestPermissions(this, permissionsRequired,
PERMISSION_CALLBACK_CONSTANT);
}
SharedPreferences.Editor editor = permissionStatus.edit();
editor.putBoolean(permissionsRequired[0], true).apply();
} else {
proceedAfterPermission();
}
}
示例11: startApplicationDetailsSettings
public static void startApplicationDetailsSettings(Context context, String packageName) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", packageName, null);
intent.setData(uri);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
context.startActivity(intent);
}
示例12: onClickSetting
/**
* 点击去设置
*/
public void onClickSetting() {
Uri packageURI = Uri.parse("package:" + AppUtils.getAppPackageName());
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, packageURI);
mContext.startActivity(intent);
cancel();
}
示例13: onRequestPermissionsResult
@Override
public void onRequestPermissionsResult(int requestCode, @android.support.annotation.NonNull String[] permissions, @android.support.annotation.NonNull int[] grantResults) {
switch (requestCode) {
case 1:
for (int i = 0; i < grantResults.length; i++) {
if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {//权限未同意
boolean bannedPermission = ActivityCompat.shouldShowRequestPermissionRationale(X5WebViewBrowseActivity.this, permissions[i]);//是否未禁止权限
if (bannedPermission) {//用户未禁止
ActivityCompat.requestPermissions(X5WebViewBrowseActivity.this, new String[]{Manifest.permission.CALL_PHONE}, 1);//重新申请权限
return;
} else {//禁止权限,标记
weatherBannedPermission = true;
}
}
}
/**
* 判断是否禁用权限
*/
if (weatherBannedPermission) {
ToastUtils.showShort("请手动打开电话权限");
Uri packageURI = Uri.parse("package:" + AppUtils.getAppPackageName());
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, packageURI);
startActivity(intent);
} else {
startCallPhone();
}
break;
default:
break;
}
}
示例14: startAppSettings
private void startAppSettings() {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
intent.setData(Uri.parse(PACKAGE_URL_SCHEME + getPackageName()));
startActivity(intent);
}
示例15: toAppSystemSettings
public void toAppSystemSettings(String packageName) {
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", packageName, null));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
activity.startActivity(intent);
}