Android怎样监听并打开关闭GPRS?该怎么解决
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());
}
从网上搜了很久,资料比较少,搜出来的好像也不能用,不知道怎样打开和关闭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());
}