mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-24 08:38:51 -05:00
Fix NPE related to changed initialization order in Android 4.2
This commit is contained in:
parent
f0118ecb85
commit
b96e7bb058
@ -539,8 +539,10 @@ public class MessageViewFragment extends SherlockFragment implements OnClickList
|
||||
}
|
||||
|
||||
private void configureMenu(Menu menu) {
|
||||
// first run displayMessage() gets called before onCreateOptionMenu()
|
||||
if (menu == null) {
|
||||
// In Android versions prior to 4.2 onCreateOptionsMenu() (which calls us) is called before
|
||||
// onActivityCreated() when mAccount isn't initialized yet. In that case we do nothing and
|
||||
// wait for displayMessage() to call us again.
|
||||
if (menu == null || mAccount == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user