Wal*_*ter 5 android android-settings android-security
我想让用户在启用后重定向到开发人员选项->模拟位置。我的要求是,当跟踪到任何虚假的 GPS 位置时,我需要重定向到开发人员选项-> 选择模拟位置应用程序以禁用。
if (AppUtils.isMockLocationEnabled(mLastLocation, FeedbackActivity.this)) {
final Dialog dialog = new Dialog(FeedbackActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.custom_alert_response_accepted1);
Button ok = (Button) dialog.findViewById(R.id.ok_button);
TextView textView = (TextView) dialog.findViewById(R.id.response);
textView.setText("Turn off Fake Gps");
Button cancel = (Button) dialog.findViewById(R.id.Cancel_button);
dialog.setCancelable(false);
dialog.show();
ok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS));
//I tried this but this is not working..
Settings.Secure.getString(getContentResolver(), "mock_location");
}
});
}
Run Code Online (Sandbox Code Playgroud)
我尝试了这个“mock_location”,但它不会选择模拟位置应用程序。没有任何表现..
//下面这只是仅打开开发者选项。如何重定向到开发者设置中的模拟位置以关闭?
startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1973 次 |
| 最近记录: |