Almost all the activities in my application need to interact with a web server to get data and then load the Activity screens. So at any moment if the internet is slow, it takes a lot of time and after some 12-15 secs it says “unable to load, ForceClose/Wait”. How does applications avoid this? What is the solution they follow, when 1st 3-4 activities work fine (when net is good) then some Activity takes long(because of bad internet/ if internet is gone)
Share
By Optimizing your code, Secondly do your Network/Internet work on a separate thread(like AsynTask).
Link: http://developer.android.com/reference/android/os/AsyncTask.html
This will not block your UI.
Hope This Help