Your problem is here:
new DownloadFile().execute();
new ReadFile().execute();
As these are Asynchronous Tasks, they're running at the same time, and ReadFile
is attempting to open your image file before DownloadFile
has finished.
You merely need to move the new ReadFile().execute();
to the onPostExecute()
method of DownloadFile
.
Then also add the following to ReadFile
, to get the ImageView to refresh:
@Override
protected void onPostExecute(Drawable nada) {
fileImageView.invalidate();
}
I tested to make sure that's all that was needed, and got a picture of Putin with a dog.