listview中OnItemClick方法各个参数的作用

OnItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) 

1、arg0,arg2

m_listview.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> arg0, View arg1, int postion,long arg3) {
            Intent intent = null;
            switch (postion)
    {
        case 0:intent = new Intent(arg0.getContext(), Activity01.class);break;
        case 1:intent = new Intent(arg0.getContext(), Activity01.class);break;
 
    }
        startActivity(it);
            }
});

2、arg1

public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub
		          tv=(TextView)arg1.findViewById(R.id.textView1);	          
		          ss=tv.getText().toString();
		         db. delete("good", " goodname=?", new String[]{ss});
		
		         

  

posted @ 2016-07-14 13:45  LibraSun  阅读(3084)  评论(0编辑  收藏  举报