reparent if parented (Cheogram)

This commit is contained in:
Arne 2023-05-24 18:58:16 +02:00
parent 4b722cce64
commit 72a6b50bf9

View file

@ -1773,10 +1773,16 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
@Override
public Object instantiateItem(@NonNull ViewGroup container, int position) {
if (position == 0) {
if (page1 != null && page1.getParent() != null) {
((ViewGroup) page1.getParent()).removeView(page1);
}
container.addView(page1);
return page1;
}
if (position == 1) {
if (page2 != null && page2.getParent() != null) {
((ViewGroup) page2.getParent()).removeView(page2);
}
container.addView(page2);
return page2;
}