Kreepz
Kreepz

Reputation: 149

Android change Fragment in FragmentActivity when asynctask run

Here is the context, I've a FragmentActivity with Fragment inside.

The FragmentActivity contains tabInfo and when the user click on it, I change the Fragment.

But when the user come on the FragmentActivity, I launch a asynctask for load pictures. And I can't changed tab until the asynctask is finished...

Upvotes: 0

Views: 54

Answers (1)

Marcos Vasconcelos
Marcos Vasconcelos

Reputation: 18276

You can use the publishProgress from inside doInBackground and override onProgressUpdate to display something into UI thread.

Inside doInBackground you can't touch your views, also the process is termitent in the thread so all your change fragment actions will be executed when its done.

Upvotes: 1

Related Questions