以下代码在三星设备中启动 GPS 设置屏幕,但在 HTC 设备中启动设置的安全屏幕。我如何编写代码,以便它独立于设备启动 GPS 屏幕。请帮助是否有任何替代解决方案
final ComponentName toLaunch = new ComponentName("com.android.settings","com.android.settings.SecuritySettings");
final Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(toLaunch);
startActivity(intent);
摆脱setComponent()
and addCategory()
打电话看看是否有帮助。在任何情况下你都不应该使用它们,特别是ComponentName
硬连接无效的包和类名。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)