WIFI = (Spinner) findViewById(R.id.WIFI);
// Create an ArrayAdapter using the string array and a default spinner layout
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this,
R.array.WIFI, android.R.layout.simple_dropdown_item_1line);
// Specify the layout to use when the list of choices appears
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
// Apply the adapter to the spinner
WIFI.setAdapter(adapter);
WIFI.setOnItemSelectedListener(new MyOnItemSelectedListener());
How to enable wifi by selecting it from spinner.
I’ll be thankful to you
Add this piece of code to your listener
or for toggle behaviour
You will probably need to add some permissions to your manifest
See WifiManager for more options…
And as far as I know, there is no API for hotspot features. You would have to use reflection to call those methods…