startActivity for external app needs <activity> declared?
<p>I want to be able to open Android's stock Wifi Settings screen from my app, got this code:</p>

<pre><code>Intent settings = new Intent(Settings.ACTION_WIFI_SETTINGS);
settings.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(settings);
</code></pre>

<p>I get "Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@45a3df40"</p>

<p>If I'm correct I need to declare the activity in my manifest.. but HOW? I've tried this:</p>

<pre><code>&lt;activity android:name="android.settings.WIFI_SETTINGS" /&gt;
</code></pre>

<p>Or am I doing something else wrong??</p>

<p>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.</p>

<p>The answer below DOES work in pretty much every other scenario.. :)</p>
