I have been trying to use ArrayList.add
, when I was putting just .add("some data")
it worked fine, when I tried assigning the id - .add(1, "some data");
I keep getting the error when I try running the app - "The application MobileApp(process com.example.mobileapp) has stopped unexpectedly. Please try again.".
This is the next code that I am running:
List<String> log = new ArrayList<String>();
log.add(1, "some data");
This works fine:
List<String> log = new ArrayList<String>();
log.add("some data");
What I want to achieve from this:
ListView
will have list of items, each item would have specific "id".- On click this "id" will be picked up and user is moved to different layout where further information is shown on item with selected "id".