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 -

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

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -