Merge pull request #2735 from trashkalmar/bottomsheet-crash

[android] fix: Crash in BottomSheet dialog after activity finished.
This commit is contained in:
Dmitry Yunitsky 2016-04-05 13:09:53 +03:00
commit 86d4446e86

View file

@ -2,6 +2,7 @@ package com.mapswithme.util;
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.support.annotation.DrawableRes;
@ -185,7 +186,12 @@ public final class BottomSheetHelper
if (ref != null)
{
if (ref.isShowing())
ref.dismiss();
{
Activity activity = (Activity)((ContextWrapper)ref.getContext()).getBaseContext();
if (!activity.isFinishing())
ref.dismiss();
}
sRef = null;
}
}