I have a long Array, and for every long value i m using this query to fetch a string Array from sqlite database.
long[] mylong= {1,3,5,6,7};
Dbadapter finaldb = new Dbadapter(this);
for(int i=0; i<mylong.length; i++) {
finaldb.open();
String[] string_array = finaldb.getArray(mylong[i]);
finaldb.close();
now, i want to store these different string arrays with some name so that i can use them after. but i don't know how to achieve this. If any one can guide me in the right direction?
You can have ArrayList<String[]>
to store arrays and add those array to list and use get method to retrieve the array or you can use Map<key,value>
to manage the key value based structure for retrieval of array.
FOR EXAMPLE
String str[]=new String[10];
str[0]="abc";
//and other values
List<String[]> list=new ArrayList<String[]>();
list.add(str);
//OR
Map<Long,String[]> map=new HashMap<Long,String[]>();
map.put(myLong[0],str);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments