I want to be able to open Android's stock Wifi Settings screen from my app, got this code:
Intent settings = new Intent(Settings.ACTION_WIFI_SETTINGS);
settings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(settings);
I get "Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@45a3df40"
If I'm correct I need to declare the activity in my manifest.. but HOW? I've tried this:
<activity android:name="android.settings.WIFI_SETTINGS" />
Or am I doing something else wrong??
UPDATE: I was trying to access the Wifi Settings Activity from an PreferenceActivity's onOptionsItemSelected method. This DOES NOT WORK for either startActivity, startService OR sendBroadcast.
The answer below DOES work in pretty much every other scenario.. :)