Skip to content

Commit 4ae16ef

Browse files
committed
Clear parent from customView if parent is not null
1 parent 94f3b6e commit 4ae16ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/java/fr/free/nrw/commons/utils/DialogUtil.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import android.app.Dialog;
66
import android.content.DialogInterface;
77
import android.view.View;
8+
import android.view.ViewGroup;
89

910
import org.apache.commons.lang3.StringUtils;
1011

@@ -116,6 +117,8 @@ private static void showAlertDialog(Activity activity,
116117
final Runnable onNegativeBtnClick,
117118
View customView,
118119
boolean cancelable) {
120+
if (customView != null && customView.getParent() != null)
121+
((ViewGroup) customView.getParent()).removeAllViews();
119122
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
120123
builder.setTitle(title);
121124
builder.setMessage(message);

0 commit comments

Comments
 (0)