N
N
Neonoviiwolf2017-01-26 14:14:56
Java
Neonoviiwolf, 2017-01-26 14:14:56

Access a specific CardView and remove content?

Good!
The layout container is in the card, I fill it with fragments. Each fragment has a remove button, which, when clicked, should indicate that the fragment in which it lies should be removed. How can I find out in which card and which fragment should be deleted?
And how to get to the contents of the container?

public FineHolder(final View itemView) {
            super(itemView);
 LinearLayoutCompat layout = (LinearLayoutCompat) cardView.findViewById(R.id.container);

            for (int i = 0; data.get(position).getListsCard().size() > i; ++i) {
                ArrayList<String> list = data.get(position).getListsCard().get(i);

                ItemMenu itemMenu = new ItemMenu();
                View view =  itemMenu.onCreateView((LayoutInflater) itemView.getContext().
                        getSystemService(Context.LAYOUT_INFLATER_SERVICE), (ViewGroup) itemView, new Bundle());
                itemMenu.setProductNameEditText(list.get(0));
                
                layout.addView(view);
            }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question