首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

Android怎么监听并打开关闭GPRS

2013-01-11 
Android怎样监听并打开关闭GPRS?从网上搜了很久,资料比较少,搜出来的好像也不能用,不知道怎样打开和关闭GP

Android怎样监听并打开关闭GPRS?
从网上搜了很久,资料比较少,搜出来的好像也不能用,不知道怎样打开和关闭GPRS呢,监听已经可以了。
[解决办法]
Intent gpsIntent = new Intent();
gpsIntent.setClassName("com.android.settings",
"com.android.settings.widget.SettingsAppWidgetProvider");
gpsIntent.addCategory("android.intent.category.ALTERNATIVE");
gpsIntent.setData(Uri.parse("custom:3"));
try {
PendingIntent.getBroadcast(FusionField.currentActivity, 0,
gpsIntent, 0).send();
} catch (Exception e) {
UtilLog.e("LogicFacade........toggleGPS", e.getMessage());
}

热点排行