Friday, 23 August 2013

Get the value of the Item in the Listview

Get the value of the Item in the Listview

I have an array of Strings i.e. String [] values ={"Adult 1","Adult
2","Child 1","Child 2","Infant 1","Infant 1"};
With this array I am creating a listView . On click on a listview item, I
am opening a custom dialog that have 2 edit text and on TextView.
So click on the item I want to set the value of edit text with the value
of item, if it is not Adult, Child or Infant.
And I also want to check - if the item is not adult, I have to set the
visibility of textview in the custom dialog visible.
How could I do this?
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
}
});

No comments:

Post a Comment