Finish the calling activity when AsyncTask completes

后端 未结 6 1489
挽巷
挽巷 2020-12-16 15:41

My calling activity:

public class Hello extends Activity {  

public void onCreate(Bundle savedInstanceState) {

    MyTask mt = new MyTask(this);
    mt.exe         


        
6条回答
  •  我在风中等你
    2020-12-16 15:52

    Define a method in your activity class like this:

    public void FinishAfterAsyncTask()
    {
       this.finish();
    }
    

    And call this method from the OnPostExecute method of the AsynTask class.

提交回复
热议问题