I have a Button that downoad a File, and works fine. If I dont have Internet conection, the file doesnt download (obviously). The problem is that the app continues trying to download, instead of stop it.
I want to show a Toast saying "The device its not connected" or some stuff like that and NOT begin the download process then. I want a function that returns true or false if I have WIFI connection avaiable AT THE MOMENT or not
I try with the answers of these post: How to check currently internet connection is available or not in android , but the function retuns always true, even with Airplane mode.
I download the File with a DownloadManager and continues after download with a BroadcastReceiver.