How to navigate to Google map app info settings screen in android programmatically

微笑、不失礼 提交于 2019-12-11 13:22:44

问题


How to open Google maps settings info screen like above image in android from my app.I tried the following code but it is not working.
     String packageName = "com.google.android.maps";
          Intent intent = new Intent();
         final int apiLevel = Build.VERSION.SDK_INT;
    if (apiLevel >= 9) { // above 2.3

        intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);

        Uri uri = Uri.fromParts(SCHEME, packageName, null);

        intent.setData(uri);

    } else { // below 2.3

        final String appPkgName = (apiLevel == 8 ? APP_PKG_NAME_22: APP_PKG_NAME_21);

        intent.setAction(Intent.ACTION_VIEW);

        intent.setClassName(APP_DETAILS_PACKAGE_NAME,APP_DETAILS_CLASS_NAME);

        intent.putExtra(appPkgName, packageName);

   }
    startActivity(intent);

        }

If I am using my app package name it is navigating to settings info screen but if i am using google maps packgae name it is not navigating.Please help me on this. Thanks in advance.

来源:https://stackoverflow.com/questions/23219249/how-to-navigate-to-google-map-app-info-settings-screen-in-android-programmatical

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!