0

I want to develop an android application using listView, what I want to do is when I press on an Item on the list it will take me to another activity and so on, how can I do that

ruaa.brkat
  • 41
  • 1
  • 8

2 Answers2

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));
}
});
Droidman
  • 11,485
  • 17
  • 93
  • 141
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);
   }

});

Devrim
  • 15,345
  • 4
  • 66
  • 74