InputStream from URL in AsyncTask
问题 Trying to get a file from URL into InputStream element (with AsyncTask) and then use it, but so far unsuccessful. Are the parameters right for AsyncTask? Can I check InputStream like I did in my code or is it wrong and it will always return null? Any other changes I should make? My code: String url = "https://www.example.com/file.txt"; InputStream stream = null; public void load() { DownloadTask downloadTask = new DownloadTask(); downloadTask.execute(url); if (stream == null) { //fail, stream