Android编程打开数据使用设置页面

时间:2015-03-05 09:02:41

标签: android android-intent

在Android 5.0中,“数据使用”设置中提供了“移动数据”设置 我想在android中打开数据使用设置页面,但我找不到任何打开它的Intent。有什么原因打开数据使用设置页面

2 个答案:

答案 0 :(得分:0)

你试过这种方式吗?

final  Intent intent=new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
final ComponentName cn = new ComponentName("com.android.phone","com.android.phone.Settings");
intent.setComponent(cn);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);

也许这样:

startActivityForResult(new Intent(android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS), 0);

答案 1 :(得分:0)

尝试使用此

startActivityForResult(new Intent(android.provider.Settings.ACTION_NETWORK_OPERATOR_SETTINGS), 0);

或者

Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);