I want to call a Fragement from my BaseAdapter Class. In this class I have button on click of which I want to call the new fragment, but I am not able to get this. I have to
Easiest way: Do in Fragment
Adapter a = new Adapter(arg,Fragment.this);// or only this. This will pass the fragment object to the adapter.
and in Adapter
v.ckbox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(fragment!=null)
fragment.ValidateList();// call any public method of the fragment
}
});