android - Turn on Packet Data in dual sim phone -


i'm using function turning on packet data:

public static void setdatanetworkenable(context mcontext) {     try {         connectivitymanager conman = (connectivitymanager) mcontext                 .getsystemservice(context.connectivity_service);         class<?> conmanclass = class.forname(conman.getclass().getname());         field iconnectivitymanagerfield = conmanclass                 .getdeclaredfield("mservice");         iconnectivitymanagerfield.setaccessible(true);         object iconnectivitymanager = iconnectivitymanagerfield.get(conman);         class<?> iconnectivitymanagerclass = class                 .forname(iconnectivitymanager.getclass().getname());         method setmobiledataenabledmethod = iconnectivitymanagerclass                 .getdeclaredmethod("setmobiledataenabled", boolean.type);         setmobiledataenabledmethod.setaccessible(true);          setmobiledataenabledmethod.invoke(iconnectivitymanager, true);     } catch (exception e) {         e.printstacktrace();     } } 

but doesn't work in dual sim phone...

does solution exist?


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -