I've got a ListView which I made a custom adapter for it called Myadp:
public class Myadp extends ArrayAdapter {
private final String[] web;
private final String[] t;
public Myadp(Context context, int resource, int textViewResourceId, final String[] objects, String[] total) {
super(context, resource, textViewResourceId, objects);
this.web = objects;
this.t = total;
}
@Override
public View getView(final int position, final View convertView, ViewGroup parent) {
final LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View row = inflater.inflate(R.layout.list_temp, parent, false);
TextView tv2 = (TextView) row.findViewById(R.id.textView2);
TextView tv4 = (TextView) row.findViewById(R.id.textView4);
tv2.setText(web[position]);
tv4.setText(String.valueOf(t[position]));
ImageButton del = (ImageButton) row.findViewById(R.id.imageButton);
del.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
});
return row;
}
}
and when user click on del ImageButton that item will be deleted. I tried a lot, for example I tried to delete that item from the array(both web & t array) and re-call the ListView adapter but I wasn't successful, I've searched google and Stackoverflow but all of the codes are just for simple listview adapter. So now I need your helps.