Hello,
I need to do an internet access to update a field on my UI. I do the
internet access in a background thread by extending AsyncTask.
Since I need to update my UI every time the screen is refreshed I am
executing the AsyncTask in my onResume method:
@Override
protected void onResume(){
super.onResume();
showDialog(REFRESH_DIALOG);
new UpdateAgentStatusTask().execute();
}
I dismiss the REFRESH_DIALOG dialog in the onPostExecute() method in
the AsyncTask.
For testing I rotate the screen to landscape. Things work well. The
problem is when I try to rotate again to portrait. I get
'java.lang.IllegalArgumentException: no dialog with id 1 was ever
shown ...'. id 1 is for the REFRESH_DIALOG.
How do I get rid of this error? Is there a better way to do an
internet access to update my UI every time the screen is refreshed?
Thanks,
Prasanna
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en