android - Using Static Application Context -


i having issue handler returning during screen rotation, meaning activity had not been created yet , causing error.

i solved via post: static way 'context' on android?

which sets application level static context use. wanted know how safe use , if there instances shouldn't use this, don't entirely understand it.

thanks,

kevin.

no, horrible way solve it. means you're using application context instead of activity context, wrong , can cause memory leaks. correct way either check condition before ding can cause error, or catch exception caused , eat it.

really best way solve turn off activity recreation on rotation , has been stupid idiotic idea google.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -