Google play does this when you try to use it and happen to not be connected to a wifi network.
photo of what I\'m trying to do:
Intent intent = new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK);
intent.putExtra("only_access_points", true);
intent.putExtra("extra_prefs_show_button_bar", true);
intent.putExtra("wifi_enable_next_on_connect", true);
startActivityForResult(intent, 1);
This should do it. Reverse engineered from google code.
This is just an improvement of UncleKing's answer.
Since you ask specifically for
How can I get buttons overlayed on to what you see with a WifiManager.ACTION_PICK_WIFI_NETWORK?
There is no need for the extras only_access_points
and wifi_enable_next_on_connect
. You only need the extra_prefs_show_button_bar
extra. The overlay buttons will appear just by using this last extra.
You can try this using ADB if you want:
am start -a android.net.wifi.PICK_WIFI_NETWORK --ez extra_prefs_show_button_bar True
So the reduced code would be:
Intent intent = new Intent(WifiManager.ACTION_PICK_WIFI_NETWORK);
intent.putExtra("extra_prefs_show_button_bar", true);
startActivityForResult(intent, 1);
Tried it on Android 4.1, 4.4 and 5.1.