I have an array adapter and inside it an Imagebutton listener calling an activity.
Above my ListView I have and a input search of a ListView item.
When I search for an item by typing the initial letters and Click on Image Button
viewHolder.discounts.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), DisplayDiscounts.class);
intent.putExtra("CustomerId",String.valueOf(cu.getId()));
((Customers) getContext()).startActivity(intent);
}
});
I get java.lang.ClassCastException: android.app.ContextImpl cannot be cast to "ActivityName"
How I can fix this?
Can I stop the input search when item found?