我想使用listView开发一个android应用程序,我想做的是当我按下列表上的一个项目时,它会将我带到另一个活动等等,我该怎么做
问问题
681 次
2 回答
1
I want to develop an android application using listView
I guess you should try using Eclipse ADT to develop apps :D
What you are looking for is an OnItemClickListener
. Usage:
yourListView.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
startActivity(new Intent(CurrentActivity.this, yourNextActivity.class));
}
});
于 2013-11-02T19:02:54.133 回答
0
there are many samples for this. To summarize it will be something like this:
yourListView.setOnItemClickListener(new OnItemClickListener(){
public void onItemClick(AdapterView<?> parent, View view, int position, long id){
Intent intent = new Intent(<YourCurrentActivity>.this, <YourNextActivityToStart>.class);
startActivity(intent);
}
});
于 2013-11-02T19:02:01.133 回答