0
votes

I am trying to open WiFi activity from my android App on Android Things preview 6 version. Below code works for mobile but gives error for Android Things preview 6 on Raspberry Pi 3

startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));

Error

E/AndroidRuntime: FATAL EXCEPTION: main Process: com.embdroid.android.homegatewayapp, PID: 11302 android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.settings.WIFI_SETTINGS }

2

2 Answers

3
votes

The default WiFi settings activity has been removed in recent previews. You can use the network manager APIs to programmatically connect to networks or use the default launcher which has a WiFi settings section.

0
votes

Try with this sometime it needs complete path:

           Intent i = new Intent();
           i.setClassName("com.android.settings",
           "com.android.settings.wifi.Settings_Wifi_Settings");
            startActivity(i);

let me know if it works for you or not.