onclicklistener用于膨胀的表格行

时间:2012-06-05 20:41:37

标签: android tablerow onclicklistener

这是我为约会生成列表的代码。我动态地给桌子充气并向他们添加了onclicklisteners,但不知何故它没有被检测到..

TableRow tr1 = (TableRow)inflater.inflate(R.layout.appointment_list, null);
tr1.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
TextView Name=(TextView) tr1.findViewById(R.id.appointment_name);
TextView Time=(TextView) tr1.findViewById(R.id.appointment_time);

date_today.setTime(cur.getLong(3));
String s=""+date_today.getHours()+":"+date_today.getMinutes();
Name.setText(cursorName.getString(1));
Time.setText(s);

tr1.setClickable(true);
tr1.setOnClickListener(this);
table.addView(tr1, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));

0 个答案:

没有答案