Android开发Button按钮问题
凌云天下 2011-10-08 08:49:46 for (int i = 0; i < res.length; i++) {
final String[] advert = res[i].split("/");
TableRow row = new TableRow(this);
row.setLayoutParams(param2);
Button button = new Button(this);
button.setBackgroundResource(R.drawable.back);
button.setText(advert[1]);
button.setOnClickListener(new OnClickListener(){
public void onClick(View v) {
try {
fileService.save("advertId", advert[0]);
} catch (Exception e) {
e.printStackTrace();
}
Intent intent = new Intent(tjzx.this,tjzxInfo.class);
startActivity(intent);
}
});
button.setTextSize(20);
row.addView(button);
table.addView(row);
}
帮忙看一下,为什么在点击Button的时候冲突??怎样解决这个问题呢??