0

Actually I want to enable data connection when I enter wrong password on android phone. I used a ConnectivityManager but it is not working fine. Here is source code for which I used.

ConnectivityManager dataManager;
  dataManager  =(ConnectivityManager)ctxt.getSystemService(CONNECTIVITY_SERVICE);
  Method dataMtd = null;
 dataMtd =ConnectivityManager.class.getDeclaredMethod("setMobileDataEnabled", boolean.class);
dataMtd.setAccessible(true);
dataMtd.invoke(dataManager, true);
pleft
  • 7,567
  • 2
  • 21
  • 45
Wahab Raja
  • 51
  • 1
  • 8

0 Answers0