Closed Bug 1293595 Opened 9 years ago Closed 9 years ago

Crash in java.lang.NullPointerException: at org.mozilla.gecko.BrowserApp.onAttachedToWindow(BrowserApp.java)

Categories

(Firefox for Android Graveyard :: General, defect, P1)

All
Android
defect

Tracking

(firefox51 fixed)

RESOLVED FIXED
Firefox 51
Tracking Status
firefox51 --- fixed

People

(Reporter: sebastian, Assigned: ahunt)

Details

(Keywords: crash, Whiteboard: [TPE-1][MobileAS])

Crash Data

Attachments

(1 file)

This bug was filed from the Socorro interface and is report bp-574fbead-c16b-4a44-8201-7beb72160803. ============================================================= > java.lang.NullPointerException > at org.mozilla.gecko.BrowserApp.onAttachedToWindow(BrowserApp.java:975) > at android.support.v7.internal.view.WindowCallbackWrapper.onAttachedToWindow(Unknown Source) > at com.android.internal.policy.impl.PhoneWindow$DecorView.onAttachedToWindow(PhoneWindow.java:2469) > [..]
Based on the most recent reports, this seems to be happening at: mDoorhangerOverlay.setVisibility(View.VISIBLE); I don't see how this would happen unless the layout hasn't been inflated yet, in this case layout inflation happens in GeckoApp.onCreate(). There don't seem to be any guarantees about onAttachedToWindow happening before or after onCreate, if it happens before onCreate, we don't have a layout, and findViewById will return null. (That does however seem implausible, shouldn't onCreate be one of the first calls?) Looking back at the history: it looks like we wanted to show this doorhanger on all devices except 2.3, but nowadays we show the doorhanger on all supported devices - so we should just set it to visible in the layout, and not flip the visibility in code: https://hg.mozilla.org/mozilla-central/diff/5a706e4cc1f0/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java#l1.12
Assignee: nobody → ahunt
We still need to set mDoorHangerOverlay for other parts of BrowserApp, but we can findViewById() it during onCreate instead of onAttachedToWindow, which seems more standard / reliable?
Whiteboard: [TPE-1] → [TPE-1][MobileAS]
Comment on attachment 8782982 [details] Bug 1293595 - Make doorhanger overlay visible by default, and retrieve it during onCreate https://reviewboard.mozilla.org/r/72976/#review71352
Attachment #8782982 - Flags: review?(s.kaspari) → review+
Can we land this?
Flags: needinfo?(ahunt)
Pushed by ahunt@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fcdac0d4b2d5 Make doorhanger overlay visible by default, and retrieve it during onCreate r=sebastian
Flags: needinfo?(ahunt)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Iteration: --- → 1.3
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: