You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Usually onPrepareOptionsMenu method is called after all bean-objects have been injected, but in Android 4.1.1, 4.1.2 and possibly in other versions it happens vice versa.
This unexpected behavior may cause NullPointerException.
Method init_(Bundle savedInstanceState) (in generated class that extends Activity or Fragment) calls setHasOptionsMenu(true), which may have different implementations in various Android versions.
In this case it calls onPrepareOptionsMenu method immediately, but in Android 4.2+ versions onPrepareOptionsMenu call is postponed.
That's why it would be better to improve AndroidAnnotations lib to exclude calling onPrepareOptionsMenu method before bean-objects (and others) are injected.
In development we are using AndroidAnnotations version of 3.2.