by deenybird » Tue Jan 27, 2009 12:47 am
thanks for your prompt reply mr snowflake.
I am having trouble figuring out which listview method i need to use to get the variable which represents the selected item in the listview.
I believe its setonitemselectedlistener, but in the parenthesis of the method that it creates are variables like View arg1, int arg2 etc... Does it work like a spinner where the first item has the ID of 0, the second item ID is 1, or is there an if statement for the string? Also, should I be using a listadapter versus an arrayadapter for this?
listview1.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
Intent.putExtra(someKey, ID)
}
}
I would assume your previous answer would go in the selecteditem method as i listed above, but which one of those (somekey or ID) represents the item i'm pulling from that method? So once i have the key do i have to use an intent to grab it in the other class, or can i call it by itself without using an intent?