public class MyAdapter extends SimpleCursorAdapter { private LayoutInflater mInflater; public MyAdapter(Context context, int layout, Cursor c, String[] from,
int[] to) {
super(context, layout, c, from, to); // TODO Auto-generated constructor stub
} public void bindView(View view, Context context, Cursor cursor) {
RelativeLayout rl = null;
if (view == null) { rl = (RelativeLayout) mInflater.inflate(R.layout.listtrans,
null); } else { rl = (RelativeLayout) view; }
int nCount = cursor.getPosition();

int idCol = cursor.getColumnIndex("_id"); int englishCol = cursor.getColumnIndex("english_word");
int chineseCol = cursor.getColumnIndex("chinese_word"); id = cursor.getInt(idCol);//全局变量id

//System.out.println("_id = " + id);
TextView e = (TextView) rl.findViewById(R.id.eView);
TextView c = (TextView) rl.findViewById(R.id.cView);
ImageView btnImage = (ImageView) rl.findViewById(R.id.deleteBtn);

e.setText(cursor.getString(englishCol));
c.setText(cursor.getString(chineseCol));
btnImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//我这里该如何写可以获取到当前按钮list对应的数据库的ID
//在这里如果调用全局变量id 总是显示最后一条id的值
//System.out.println();
// imPictureDelete(id); } }); }