java - How can I change Swingworker to AsyncTask in Android? -


how can change swingworker asynctask in android?

my code follows.

private void showweather() {         // todo auto-generated method stub          swingworker worker = new swingworker<weatherinfo,object>()          {              public weatherinfo doinbackground()              {                  yahooweather yahooweather = new yahooweather();                  return yahooweather.getweatherinfo();              }              public void done()              {                  try {                       weatherinfo winfo = get();   // weatherinfo result background thread                       updategui(winfo);                     }                     catch(exception e){}               }          };          worker.execute();     } 

you should using asynctask instead


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -