1
如何爲綁定視圖添加適配器的點擊處理程序?剛開始。謝謝。如何在BindView中添加Click事件?
如何爲綁定視圖添加適配器的點擊處理程序?剛開始。謝謝。如何在BindView中添加Click事件?
將此放入binderView中 - 無論如何我都爲我工作。
public void bindView(View v, Context context, final Cursor c) {
int tvGoto = c.getColumnIndexOrThrow("mColumn");
final String gotoLink = c.getString(tvGoto);
TextView gotoTxt = (TextView) v.findViewById(R.id.mRID);
if (gotoTxt != null) {
gotoTxt.setText(gotoLink);
}
....
v.setTag(gotoLink);
final ListView lv = getListView();
lv.setEnabled(true);
lv.setClickable(true);
lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View v, int arg2,
long arg3) {
String url = "";
url = (String) v.getTag();
Intent i = new Intent(QueryDisplay.this, DocView.class);
QueryDisplay.this.startActivity(i);
}
});
}