读书人

Android怎么监听并打开关闭GPRS

发布时间: 2013-01-11 11:57:35 作者: rapoo

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());
}

读书人网 >Android

热点推荐