Java Code Examples for android.provider.Settings#ACTION_APPLICATION_DETAILS_SETTINGS

The following examples show how to use android.provider.Settings#ACTION_APPLICATION_DETAILS_SETTINGS . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * 打开应用设置界面
 *
 * @param requestCode 请求码
 *
 * @return
 */
private boolean openApplicationSettings(int requestCode) {
	try {
		Intent intent =
				new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + mActivity.getPackageName()));
		intent.addCategory(Intent.CATEGORY_DEFAULT);

		// Android L 之后Activity的启动模式发生了一些变化
		// 如果用了下面的 Intent.FLAG_ACTIVITY_NEW_TASK ,并且是 startActivityForResult
		// 那么会在打开新的activity的时候就会立即回调 onActivityResult
		// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		mActivity.startActivityForResult(intent, requestCode);
		return true;
	} catch (Throwable e) {
		Log.e(TAG, "", e);
	}
	return false;
}
 
Example 2
/**
 *  启动应用的设置
 * 
 * @since 2.5.0
 *
 */
private void startAppSettings() {
	Intent intent = new Intent(
			Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
	intent.setData(Uri.parse("package:" + getPackageName()));
	startActivity(intent);
}
 
Example 3
Source Project: libcommon   File: PermissionCheck.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * アプリの詳細設定へ遷移させる(パーミッションを取得できなかった時など)
 * @param context
 */
public static void openSettings(@NonNull final Context context) {
    final Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    final Uri uri = Uri.fromParts("package", context.getPackageName(), null);
    intent.setData(uri);
    context.startActivity(intent);
}
 
Example 4
Source Project: TraceByAmap   File: MainActivity.java    License: MIT License 5 votes vote down vote up
/**
 * 启动应用的设置
 *
 * @since 2.5.0
 */
private void startAppSettings() {
	try{
		Intent intent = new Intent(
				Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
		intent.setData(Uri.parse("package:" + getPackageName()));
		startActivity(intent);
	} catch (Throwable e) {
		e.printStackTrace();
	}
}
 
Example 5
Source Project: Dexter   File: SettingsClickListener.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void onClick(View view) {
    Context context = view.getContext();
    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);
}
 
Example 6
Source Project: FireFiles   File: PackageManagerUtils.java    License: Apache License 2.0 5 votes vote down vote up
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);
}
 
Example 7
Source Project: HayaiLauncher   File: SearchActivity.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public boolean onContextItemSelected(MenuItem item) {
    final AdapterContextMenuInfo info = (AdapterContextMenuInfo) item
            .getMenuInfo();
    final View itemView = info.targetView;
    final LaunchableActivity launchableActivity =
            (LaunchableActivity) itemView.findViewById(R.id.appIcon).getTag();
    switch (item.getItemId()) {
        case R.id.appmenu_launch:
            launchActivity(launchableActivity);
            return true;
        case R.id.appmenu_info:
            final Intent intent = new Intent(
                    Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
            intent.setData(Uri.parse("package:"
                    + launchableActivity.getComponent().getPackageName()));
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intent);
            return true;
        case R.id.appmenu_onplaystore:
            final Intent intentPlayStore = new Intent(Intent.ACTION_VIEW);
            intentPlayStore.setData(Uri.parse("market://details?id=" +
                    launchableActivity.getComponent().getPackageName()));
            startActivity(intentPlayStore);
            return true;
        case R.id.appmenu_pin_to_top:
            launchableActivity.setPriority(launchableActivity.getPriority() == 0 ? 1 : 0);
            mLaunchableActivityPrefs.writePreference(launchableActivity.getClassName(),
                    launchableActivity.getLaunchTime(), launchableActivity.getPriority(), launchableActivity.getusagesQuantity());
            sortApps();
            mArrayAdapter.notifyDataSetChanged();
            return true;
        default:
            return false;
    }

}
 
Example 8
/**
 * Open app settings screen
 */
private void openAppSettings() {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
            Uri.fromParts("package", getPackageName(), null));
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);
}
 
Example 9
private static Intent google(Context context) {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.fromParts("package", context.getPackageName(), null));
    return intent;
}
 
Example 10
Source Project: Pioneer   File: Intents.java    License: Apache License 2.0 4 votes vote down vote up
public static Intent appDetailsSettings(Context context) {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.parse("package:" + context.getPackageName()));
    return intent;
}
 
Example 11
Source Project: EasyPhotos   File: SettingsUtils.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * 启动应用详情界面
 * @param cxt 上下文
 * @param packageName 应用包名
 */
public static void startMyApplicationDetailsForResult(Activity cxt, String packageName) {
    Uri packageUri = Uri.parse("package:" + packageName);
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, packageUri);
    cxt.startActivityForResult(intent, Code.REQUEST_SETTING_APP_DETAILS);
}
 
Example 12
Source Project: AndPermission   File: LSettingPage.java    License: Apache License 2.0 4 votes vote down vote up
private static Intent defaultApi(Context context) {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.fromParts("package", context.getPackageName(), null));
    return intent;
}
 
Example 13
@OnClick(R.id.action_permission_settings)
public void onPermissionSettingsClicked() {
    final Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.fromParts("package", getPackageName(), null));
    startActivity(intent);
}
 
Example 14
Source Project: Ticket-Analysis   File: PermissionUtil.java    License: MIT License 4 votes vote down vote up
public void startAppSettings(Activity activity) {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.parse(PACKAGE_URL_SCHEME + activity.getPackageName()));
    activity.startActivityForResult(intent, REQUEST_CODE_REQUEST_SETTING);
}
 
Example 15
Source Project: FireFiles   File: DirectoryFragment.java    License: Apache License 2.0 4 votes vote down vote up
public boolean onPopupMenuItemClick(MenuItem item, int position) {
	final ArrayList<DocumentInfo> docs = new ArrayList<>();
	final Cursor cursor = mAdapter.getItem(position);
	final DocumentInfo doc = DocumentInfo.fromDirectoryCursor(cursor);
	docs.add(doc);

	final int id = item.getItemId();
	switch (id) {
	case R.id.menu_share:
		onShareDocuments(docs);
		return true;

	case R.id.menu_copy:
		moveDocument(docs, false);
		return true;

	case R.id.menu_cut:
		moveDocument(docs, true);
		return true;

	case R.id.menu_delete:
		deleteDocument(docs, id);
		return true;

	case R.id.menu_stop:
		stopDocument(docs, id);
		return true;

	case R.id.menu_save:
       case R.id.menu_uncompress:
       case R.id.menu_compress:
		new OperationTask(docs, id).execute();
		return true;
       case R.id.menu_open:
		openDocument(docs.get(0));
           return true;
       case R.id.menu_details:
           Intent intent2 = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:"
                   + AppsProvider.getPackageForDocId(docs.get(0).documentId)));
           if(Utils.isIntentAvailable(getActivity(), intent2)) {
               getActivity().startActivity(intent2);
           }
           Bundle params = new Bundle();
		String type = IconUtils.getTypeNameFromMimeType(docs.get(0).mimeType);
		params.putString(FILE_TYPE, type);
		AnalyticsManager.logEvent("details", params);
           return true;
	case R.id.menu_info:
		infoDocument(docs.get(0));
		return true;

	case R.id.menu_rename:
		renameDocument(docs.get(0));
		return true;

       case R.id.menu_bookmark:
		bookmarkDocument(docs.get(0));
           return true;
	default:
		return false;
	}
}
 
Example 16
Source Project: OpenEyes   File: SpashActivity.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * 启动当前应用设置页面
 */
public void startAppSettings() {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.parse("package:" + getPackageName()));
    startActivity(intent);
}
 
Example 17
Source Project: permissive   File: MainActivity.java    License: Apache License 2.0 4 votes vote down vote up
public void openSettings(View view) {
  Intent i = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.fromParts("package", getPackageName(), null));
  startActivity(i);
}
 
Example 18
private void openSettings() {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    Uri uri = Uri.fromParts("package", context.getPackageName(), null);
    intent.setData(uri);
    ((Activity) context).startActivityForResult(intent, 101);
}
 
Example 19
Source Project: TikTok   File: PermissionSettingPage.java    License: Apache License 2.0 4 votes vote down vote up
private static Intent google(Context context) {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.fromParts("package", context.getPackageName(), null));
    return intent;
}
 
Example 20
Source Project: RxEasyHttp   File: LoginActivity.java    License: Apache License 2.0 4 votes vote down vote up
public void startAppSettings() {
    Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.parse("package:" + getPackageName()));
    startActivity(intent);
}