Android AsyncTask terminated before completion if connection or device is slow -


i have asynctask invoke method download data internet , performs operations.

in emulator works despite connection speed on real devices if connection or device isn't fast task automatically terminated. don't know why, there kind of default timeout in android default task management.

how fix problem?

how force completion of task always?

here code

mytask = new asynctask<void, void, void>() {             progressdialog pd;             boolean correctlyinitialized = true;               @override             protected void onpreexecute() {                 pd= new progressdialog(catchertree.this);                   pd.setcancelable(false);                 try {                     pd.show();                 } catch (error e) {                     e.printstacktrace();                 }             }              @override             protected void doinbackground(void... params) {                 long t = system.currenttimemillis();                 //this method requires time complete                 updatealldataset(catchertree.this);                  return null;             }              @override             protected void onpostexecute(void rate) {                 pd.dismiss();              }         }.execute(); 

asynctasks rely on worker thread background job, , threads not disappear. guess worker thread throwing exception , terminating.

look through logcat exception, or better yet - handle exceptions correctly in updatealldataset().


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -