android - why the added fragment get click event after remove -
I am facing a strange problem I have pieces of 4, A, B, C and D In the beginning I added a piece and then changed it with piece B using the fragmentTransaction.replace (id, B)
. Then I added the fragment using the fragmentTransaction.add (id, C)
. There are some buttons in the fragment C then I use the segment Transaction.replace (id, D). The problem occurs when the fragment D appears and I tap the position where the button lies on the piece C, click the button to remove it.
I can not understand why this happens, if I replace it for all pieces then it is working fine. Please help me I need to use the fragmentTransaction.add
thanks in advance.
I think you can see
And I want to see how you use the "inCreateView" piece method.
Like this?
return inflater.inflate (R.layout.fragment_main, container, false);
But, sometimes I use the piece like this:
View View = inflater.inflate (...); View.setOnTouchListener (New View.OnTouchListener) {Public Boolean On-Touch (see V, Motion Avent Event) {Return True;}};
Because I'm so lazy. Thank you for your question so that I have to find the reason for this question.
Comments
Post a Comment