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
Post a Comment