In a separate adapter class, an ImageButton is defined. I want to access it from MainActivity in order to implement adding items from the Listview to my favorites. How to contact me?
Here is the adapter class
public class MyCursorAdapter extends CursorAdapter { private int layout; //Π½ΡΠΆΠ΅Π½ Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ² ΠΊΠ»Π°ΡΡΠ° View public MyCursorAdapter(Context context, int layout, Cursor c, int flags) { super(context, c, flags); this.layout = layout; } public static class ViewHolder { public TextView txtBukva; public TextView txtSlovo; public ImageButton btnIzbrannoe; public void setBtnIzbrannoe(ImageButton btnIzbrannoe) { this.btnIzbrannoe = btnIzbrannoe; } } @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(context.LAYOUT_INFLATER_SERVICE); View view = inflater.inflate(layout, parent, false); return view; } @Override public void bindView(View view, Context context, final Cursor cursor) { ViewHolder holder = new ViewHolder(); String bukva = cursor.getString(cursor.getColumnIndex(Contract.Entry.COLUMN_SLOVO)).substring(0, 1).toUpperCase(); String slovo = cursor.getString(cursor.getColumnIndex(Contract.Entry.COLUMN_SLOVO)); String izbrannoe = cursor.getString(cursor.getColumnIndex(Contract.Entry.COLUMN_IZBRANNOE)); holder.txtBukva = (TextView) view.findViewById(R.id.txtBukva); holder.txtSlovo = (TextView) view.findViewById(R.id.txtSlovo); holder.btnIzbrannoe = (ImageButton) view.findViewById(R.id.btnIzbrannoe); holder.txtBukva.setText(bukva); holder.txtSlovo.setText(slovo); holder.btnIzbrannoe.setFocusable(false); if (izbrannoe.equals("1")) { holder.btnIzbrannoe.setImageResource(R.drawable.icon_star_yellow); } else if (izbrannoe.equals("0")) { holder.btnIzbrannoe.setImageResource(R.drawable.icon_star_outline_black); } } }