1

I am working on BroadcastReceiver app, and I am trying to enable the Mobile Data internet. I have code to enable the wifi:

public class SMSReceiver extends BroadcastReceiver {
    public void onReceive(Context context, Intent intent) {
        WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
        wifiManager.setWifiEnabled(true);
    }
}

and how do I make it to mobile intenet?

Mattia Maestrini
  • 32,270
  • 15
  • 87
  • 94
asdasd asd
  • 51
  • 7
  • Have you set the required permissions? Take a look at this answer here: http://stackoverflow.com/questions/8863509/how-to-programmatically-turn-off-wifi-on-android-device – Daniel Sep 19 '14 at 15:11
  • Have a look at this question: http://stackoverflow.com/a/11555457/3593126. – Max Klein Sep 19 '14 at 15:16

0 Answers0