To change the UI from a Asynctask in Android Java the easiest way is to pass a Context into the constructor of the AsyncTask. public class myTask extends AsyncTask<URL, Integer, Long> { Context mContext; myTask(Context context) { this.mContext = context; } protected Long doInBackground(URL… urls) { // code } protected void onPostExecute(Long result) { //