What i got for code is
String[] food = new String[]{"Salads", "Sandwiches", "Drinks"};
// My own layout = rowlayout.xml with id = label
setListAdapter( new ArrayAdapter<String>(this, R.layout.rowlayout, R.id.label, food ) );
Now i want to add an Intent to every item of the String[], but the problem is that there is no id for the items.
I am assuming you are using a ListActivity. You can override the
onListItemClickas follows:You can then use the position to decide what intent to create.