Skip to content

Instantly share code, notes, and snippets.

@kanytu
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanytu/886cdfc3d488ab86f409 to your computer and use it in GitHub Desktop.
Save kanytu/886cdfc3d488ab86f409 to your computer and use it in GitHub Desktop.
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
Method methodSet = Class.forName(tm.getClass().getName()).getDeclaredMethod( "setDataEnabled", Boolean.TYPE);
methodSet.invoke(tm,true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment