mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-22 02:36:55 +00:00
Remove view from parent before trying to insert into a new container.
This commit is contained in:
@@ -747,6 +747,7 @@ public class ConversationAdapter
|
||||
unbind();
|
||||
|
||||
if (view != null) {
|
||||
removeViewFromParent(view);
|
||||
container.addView(view);
|
||||
}
|
||||
}
|
||||
@@ -754,6 +755,12 @@ public class ConversationAdapter
|
||||
void unbind() {
|
||||
container.removeAllViews();
|
||||
}
|
||||
|
||||
private void removeViewFromParent(@NonNull View view) {
|
||||
if (view.getParent() != null) {
|
||||
((ViewGroup) view.getParent()).removeView(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class PlaceholderViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
Reference in New Issue
Block a user