Last active
August 29, 2015 14:07
-
-
Save kanytu/886cdfc3d488ab86f409 to your computer and use it in GitHub Desktop.
Disable mobile data on Android LFrom http://stackoverflow.com/questions/26380227/android-l-data-turn-off-error/26382149#26382149
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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