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? -

c# - SharpSVN - How to get the previous revision? -

php cli reading files and how to fix it? -