Android - View.GONE bug in 5.1 -


there coach marks view overlay showing during first time start of app. after user sees overlay , performs action setting view's visibility view.gone. has worked 4.0.4 - 5.0.2 versions of android. seeing crashes in our logs several 5.1 users. crashes seem saying view being set gone being nulled out , when call getvisibility() on view null pointer exception. not setting view null seems android deciding view should null since it's visibility set gone. doesn't happen every time user uses 5.1 device seems happening when user leaves app while , comes it. error occurs on 5.1, other android versions work fine.

is android 5.1 bug or need handle view's visibility differently?

edit: here stack trace. view null , why getting nullpointerexception. however, not doing make view null. believe android 5.1 deciding view should null since visibility set gone, randomly sets view null. doesn't happen in other versions of android, in android 5.0.2 code works fine.

java.lang.nullpointerexception: attempt invoke virtual method 'int android.widget.relativelayout.getvisibility()' on null object reference @ com.peaksware.trainingpeaks.activities.mainactivity.oncreateoptionsmenu (mainactivity.java:493) 


Popular posts from this blog