Skip to content

Commit

Permalink
Use view postDelayed instead of the handler to avoid unattached views…
Browse files Browse the repository at this point in the history
… crashes. (#907)
  • Loading branch information
keianhzo authored and bluemarvin committed Jan 8, 2019
1 parent e7ba50f commit 1768ea8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ private void exitFullScreenMode() {

// We need to add a delay for the exitFullScreen() call to solve some viewport scaling issues,
// See https://github.com/MozillaReality/FirefoxReality/issues/833 for more info.
getHandler().postDelayed(() -> {
postDelayed(() -> {
if (SessionStore.get().isInFullScreen()) {
SessionStore.get().exitFullScreen();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void initialize(Context aContext) {
mAudio.playSound(AudioEngine.Sound.CLICK);
}

getHandler().postDelayed(() -> handleRestartApp(), 500);
postDelayed(() -> handleRestartApp(), 500);
});
cancelButton.setOnClickListener(view -> {
if (mAudio != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected void initialize(Context aContext) {

mAdapter.notifyDataSetChanged();

handler.postDelayed(() -> {
postDelayed(() -> {
ChoiceWrapper selectedItem = mListItems[position];
if (mList.getChoiceMode() == ListView.CHOICE_MODE_SINGLE) {
if (mCallback != null) {
Expand Down

0 comments on commit 1768ea8

Please sign in to comment.