错误打开移动网络设置菜单 [英] Error opening mobile network settings menu
本文介绍了错误打开移动网络设置菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我想这个code。打开移动网络设置:
Hi I would like to open the mobile network settings with this code:
Intent intentSettings = new Intent();
intentSettings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intentSettings.setAction(Settings.ACTION_DATA_ROAMING_SETTINGS);
cont.startActivity(intentSettings);
但它给我这个错误。任何想法吗?
but it gives me this error. Any ideas anyone?
12-10 11:17:34.902: ERROR/AndroidRuntime(623): android.content.ActivityNotFoundException: No Activity found to handle Intent { action=android.settings.DATA_ROAMING_SETTINGS flags=0x4000000 }
感谢
推荐答案
要得到这个工作,改变你的意图创建以下code:
To get this working, change your intent creation to the following code:
Intent intent=new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
ComponentName cName = new ComponentName("com.android.phone","com.android.phone.Settings");
intent.setComponent(cName);
基本上Android清单需要一个组成部分过滤器。
Basically the android manifest requires a component filter.
这篇关于错误打开移动网络设置菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文