> How Can a edit my ArrayList from Code Android?

How Can a edit my ArrayList from Code Android?

Posted at: 2014-12-18 
First, you have at four different string arrays, names, years, locations and images. You do not have one array with 4 different items.

If you want to combine them, then you have to read each one, then combine them, then you can add more to your in-memory array. You cannot in code, add more strings to your string table in arrays.xml.

ArrayList All = new ArrayList();

string[] names = res.getStringArray(R.array.names);

All.Add( names );

string[] years = res.getStringArray(R.array.years);

All.Add( years );

etc, etc.

then you can add to your All array.

All.Add("More Strings to Add");

All.Add("Another String");

etc.



I

I Have an android project. in it i have a file name arrays.xml in values folder. in that file i have four string arrays..



John





1889





National Gallery, London





@drawable/john



Now i want to add more items to these arrays but from Java code....

can any one help..

i already tried other places but i no use...