安卓点击事件问题
// 添加TextView控件
for(int i = 0;i < menus.length;i++){
TextView tvMenu = new TextView(this);
tvMenu.setLayoutParams(new LayoutParams(30,30));
tvMenu.setPadding(30, 14, 30, 10);
tvMenu.setText(menus[i]);
tvMenu.setTextColor(Color.WHITE);
tvMenu.setGravity(Gravity.CENTER_HORIZONTAL);
menuLinerLayout.addView(tvMenu,menuLinerLayoutParames);
tvMenu.setOnClickListener(SlideMenuOnClickListener);
menuList.add(tvMenu);
}
// 单个菜单事件
OnClickListener SlideMenuOnClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
String menuTag =v.getText().toString();
new AlertDialog.Builder(MainActivity.this)
.setTitle("")
.setMessage(menuTag)
.setPositiveButton("确定" , null )
.show();}