Intention to open Wi-Fi Direct settings

To open WIFI settings, code:

startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));

To open WIFI Direct settings , code:

+4
source share
1 answer

Here's the manifest for this activity on KitKat,

    <activity android:name="Settings$WifiP2pSettingsActivity"
            android:taskAffinity="com.android.settings"
            android:parentActivityName="Settings$WifiSettingsActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.VOICE_LAUNCH" />
        </intent-filter>
        <meta-data android:name="com.android.settings.FRAGMENT_CLASS"
            android:value="com.android.settings.wifi.p2p.WifiP2pSettings" />
        <meta-data android:name="com.android.settings.TOP_LEVEL_HEADER_ID"
            android:resource="@id/wireless_settings" />
    </activity>

Thus, it seems that they did not reveal their clear intention. You may be able to run it through ComponentName, but the name is not guaranteed on all versions of Android.

+1
source

Source: https://habr.com/ru/post/1652245/


All Articles