Crash on run Intent Settings.ACTION_WIFI_ADD_NETWORKS

Hi all!

I have a crash on Samsung S20 FE Android 12.

When I call

startActivityForReulst(
Intent(Settings.ACTION_WIFI_ADD_NETWORKS).apply {
                    putExtra(
                        Settings.EXTRA_WIFI_NETWORK_LIST,
                        arrayListOf(networkSuggestion),
                    )
                }
)

My Application crashes with system error
FATAL EXCEPTION: main
Process: com.android.settings, PID: 3089
java.lang.IllegalArgumentException: No Wifi icon found for level: -1
at com.android.settingslib.Utils.getWifiIconResource(Utils.java:489)
at com.android.settingslib.Utils.getWifiIconResource(Utils.java:476)
at com.android.settings.wifi.addappnetworks.AddAppNetworksFragment.updateSingleNetworkSignalIcon(AddAppNetworksFragment.java:421)
at com.android.settings.wifi.addappnetworks.AddAppNetworksFragment.updateScanResultsToUi(AddAppNetworksFragment.java:790)
at com.android.settings.wifi.addappnetworks.AddAppNetworksFragment.onWifiEntriesChanged(AddAppNetworksFragment.java:815)
at com.android.wifitrackerlib.WifiPickerTracker$$ExternalSyntheticLambda2.run(Unknown Source:2)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

Phone software information:

Samsung’s mobile developers do not follow this board to prevent any potential dispute or misunderstanding as to the similarity between Unsolicited Submissions and our internally and independently developed products, technology and services.

I would suggest you open a Support Request and provide this information there.

I apologize for not being able to report this for you but they will probably want follow-up information.

Ron
Samsung Developer Relations