Are fragments running on a separate thread than the activity they were created on?
So let's say I have a fragment that calls a web-service synchronously, does it also block my main activity while retrieving data from the server?
As stated here Android UI is not thread safe and so Fragments run in the same main thread as an Activity. As such it's better to move your web-service call into an AsyncTask ar else you are at risk of freezing application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With