Update Fragment B after onClick on Fragment A using an Adapter

361 Views Asked by At

I have been able to instantiate the Fragment A click inside the BaseAdapter by doing the following

Fragment A

adapter = new CustomAdapter(getActivity(), rowItems, 4);
        setListAdapter(adapter);

CustomAdapter

 if(listType==4)
            {
                convertView = mInflater.inflate(R.layout.list_item_layout2, null);

                Button keyboard_1 = (Button)
                        convertView.findViewById(R.id.keyboard_1);

                keyboard_1.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {


                    }
                });
            }

But after the click, I need to update a View on Fragment B. If you look at the image, it explains in a very simple way.

enter image description here

How can we get a View instance from Fragment B inside the Adapter?

0

There are 0 best solutions below