I have a listvew with a castam adapter, which contains a Textview , CheckBox and a button.
When I click on imaginbutton imbutUpd , I want the fragment where the listview is located to be replaced by a new fragment.BaseAdapter Code
public class ListViewAdapter extends BaseAdapter { ArrayList<ListBase> listBases; Context context; public ListViewAdapter(Context context, ArrayList<ListBase> araylv){ if(araylv != null){ listBases = araylv; } this.context = context; } @Override public int getCount() { return listBases.size(); } @Override public Object getItem(int number) { return listBases.get(number); } @Override public long getItemId(int arg0) { return arg0; } private DBMethods dbMethods; CheckBox checkDel; ImageButton imbutUpd; BussinesRecrods bussinesRecrods; MainActivity main; int isTag; @Override public View getView(int id, View convertView, ViewGroup parent) { LayoutInflater inflater = LayoutInflater.from(context); ListBase p = getProduct(id); bussinesRecrods = new BussinesRecrods(); dbMethods = new DBMethods(context); main = new MainActivity(); if (convertView == null) { convertView = inflater.inflate(R.layout.tableinfact, parent, false); } TextView textVNotBook = (TextView) convertView.findViewById(R.id.textVNotBook); TextView textTimeDate = (TextView) convertView.findViewById(R.id.textDateTime); checkDel = (CheckBox) convertView.findViewById(R.id.checkBNotBook); imbutUpd = (ImageButton) convertView.findViewById(R.id.imageButUpdate); textVNotBook.setText(listBases.get(id).textHave); textTimeDate.setText(listBases.get(id).textTime+ " "+listBases.get(id).textDate); checkDel.setOnCheckedChangeListener(myCheckChangeList); checkDel.setTag(id); checkDel.setChecked(p.box); imbutUpd.setOnClickListener(onClickListener); imbutUpd.setTag(id); return convertView; } View.OnClickListener onClickListener = new View.OnClickListener() { @Override public void onClick(View v) { } }; }