如果是android的话,listview是可以添加点击事件还有长按事件:
mylistview.setOnItemClickListener(new OnItemClickListener(){
@Override
public void onItemClick(AdapterView> arg0, View arg1, int arg2,
long arg3) {
// TODO Auto-generated method stub
if(list.get(arg2).equals("LinearLayout"))
{
Intent intent = new Intent("com.wps.android.LINEARLAYOUT");
startActivity(intent);
}
if(list.get(arg2).equals("AbsoluteLayout"))
{
Intent intent = new Intent("com.wps.android.ABSOLUTELAYOUT");
startActivity(intent);
}
if(list.get(arg2).equals("TableLayout"))
{
Intent intent = new Intent("com.wps.android.TABLELAYOUT");
startActivity(intent);
}
}
});
如果是Android的话,Activity里有专门为list的子项点击事件处理的监听方法,如下面链接里的setOnItemClickListener()方法,专门用来监听list中的各个子项,从而在该方法中实现点击事件。http://www.cnblogs.com/pswzone/archive/2012/03/10/2389275.html