javiersantos / AppUpdater

A library that checks for your apps' updates on Google Play, GitHub, Amazon, F-Droid or your own server. API 9+ required.
Apache License 2.0
1.99k stars 413 forks source link

Improve usage of AsyncTask #122

Open rupiapps opened 6 years ago

rupiapps commented 6 years ago

hi, if there is no internetconnection then this shows a grey screen when I start my app (longer than 10 seconds -> inacceptable) I even tried to put the call into a separate thread. still the same issue.

rupiapps commented 6 years ago

now I found out why this happens. you are using AsyncTask for execution in separate Thread. But I also use AsyncTask. AsyncTask use only 1 Thread and are queued up. So my AsyncTask gets blocked if yours takes long time. This can be avoided by using "new MyAsyncTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR)" instead of "new MyAsyncTask().execute()". I will use this now in my code. please also do so. maybe there are other AsyncTasks in 3rd party code that I cannot change.