I have an ArrayList that I access in a fragment with the following code:
getData = getActivity().getIntent().getExtras().getString("importEvents");
List<String> myList = new ArrayList<String>(Arrays.asList(getData.split(",")));
myList.remove(0);
myList.remove(myList.size() - 1);
The output of this is as follows
Event1 (2017-03-13)
Event2 (2017-03-14)
Each event starts on a new line following the second ) but am I able to save everything before the first bracket as a separate string so I can assign it to another TextView in a CardView?
myList.size()will be changed once you remove the first item from the myList. So, store the size of list before you remove the first item