Code example for Method

Methods: invoke, setAccessible

0
	} 
	 
	public void enableMobileData(boolean state){
		try { 
			Method dataMtd = ConnectivityManager.class.getDeclaredMethod("setMobileDataEnabled", boolean.class);
			dataMtd.setAccessible(true);
			dataMtd.invoke(this.mdataManager, state);
		} catch (Exception e) {
			PreyLogger.e("Couldn't enable mobile data", e);
		} 
	} 
 
}