问题
I'm using Android's ConnectivityManager.networkRequest(..)
with a timeout to get a hold of a specific network after a queue from user input.
Everything works fine most of the time, but if I let the request timeout, I notice I get another Dialog saying
Something came up. The application has cancelled the request to choose a device." which requires the user to manually dismiss it before we can do any other network requests.
My questions is: How can I dismiss this dialog programmatically? I do not want to depend on a second queue from the user before re-attempting to get a hold of the network.
And yes I know I could simply get rid of the timeout, but it serves a specific purpose on the design of the app.
来源:https://stackoverflow.com/questions/65259047/android-q-connectivitymanager-requestnetwork-with-timeout-shows-error-dialog-tha