Android Q ConnectivityManager.requestNetwork with timeout shows error Dialog that stops any subsequent requests

可紊 提交于 2021-02-11 14:19:27

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!