简体   繁体   中英

How to start two asynctask in a single button click on one activity android

I am developing an application in which i need to call two AsyncTask s in a single button click in the same activity. How to do that?

Any help appreciated. Please provide some code also.

Nothing fancy, just start them one by one, they are async anyway.

private class TaskA<A,B,C> extends AsyncTask{}
private class TaskB<A,B,C> extends AsyncTask{}

onClick(View v){
    (new TaskA()).execute();
    (new TaskB()).execute();
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM