Android app not responding (ANR) -
i have android app, listens socket server , retrieves data in json format , save data in database. resource cursor adapter used display data in list. when app idle 10 minutes or more, not reponding. solutions?
anr
occurs when main thread blocked few time. specifically, 5 seconds in activity, 10 seconds in broadcastreceiver , 20 seconds in service. so, avoid anr
, need ensure don't these in ui thread: reading or writing files
, connecting internet
, operating databases
, on, spend lot of time. so, if want things above, may start new thread that. specifically, asynctask
threadhandler
, that.
i hope you.
Comments
Post a Comment