Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/192.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何启动';谷歌设置';从你的Android应用程序代码?_Android_Service_Notifications_Settings - Fatal编程技术网

如何启动';谷歌设置';从你的Android应用程序代码?

如何启动';谷歌设置';从你的Android应用程序代码?,android,service,notifications,settings,Android,Service,Notifications,Settings,如何从应用程序中打开Google Settings,以便用户能够启用Google Play服务的通知以接收多人网络游戏的邀请? 谷歌设置->玩游戏->通知(允许游戏发送请求和通知)我找到了答案: Intent settings = new Intent(); settings.setPackage("com.google.android.gms"); settings.addCategory(Intent.CATEGORY_LAUNCHER); starrtActivit

如何从应用程序中打开
Google Settings
,以便用户能够启用Google Play服务的
通知
以接收多人网络游戏的邀请?
谷歌设置->玩游戏->通知
(允许游戏发送请求和通知)

我找到了答案:

   Intent settings = new Intent();
   settings.setPackage("com.google.android.gms");
   settings.addCategory(Intent.CATEGORY_LAUNCHER);
   starrtActivity(settings);
答复:

String action = "com.google.android.gms.location.settings.GOOGLE_LOCATION_SETTINGS";
Intent settings = new Intent(action);
startActivity(settings);
研究:

不幸的是,此操作似乎没有在任何地方发布。但是,使用apktool从APK提取AndroidManifest.xml文件非常简单。我这样做了,并找到了活动声明,其中包括我们正在寻找的活动的意图过滤器:com.google.android.location.settings.GoogleLocationSettingsActivity


魔术。:)

谢谢你的回答。不幸的是,默认设置不包括至少适用于Android 2.2的游戏选项:(