自动打开移动网络 代码如下:
public void gprs(boolean isEnable)throws Exception
{
ConnectivityManager connManager=(ConnectivityManager)this.getSystemService(CONNECTIVITY_SERVICE);
Class<?> cmClass=connManager.getClass();
Class<?>[] arcClasses=new Class[1];
arcClasses[0]=boolean.class;
Method method=cmClass.getMethod("setMobileDataEnabled", arcClasses);
method.invoke(connManager, isEnable);
}