Issue
I used AsyncTask to request for a large chunk of data. When received, the data is processed inside the onPostExecute method. It may take a while to process the data.
Based from my understanding, AsyncTask is asynchronous and is independent from the UI.
- Why does my Activity freezes
onPostExecute? - Is it normal for an
Activityto freeze if processing inside theonPostExecutemethod is too long? - How do I make it such that my
Activitywon't freezeonPostExecute?
Solution
- You should do all your datasource operations like(database , network ,parsing the response.etc) in
doInBackgroundmethod. - If you want update any ui updation in async task the use
onProgressUpdate - I think you are performing any parsing operations in
onPostExecute. try getting filtered or parsed data (lighter data) inonPostExecute.
Answered By - Gani
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.