i have a xml parser with lazy adapter, i parse all the data to an list view.
now i would like to grabe all the data from the listivew(wiche is 1 textview per row) and put is in and string array
but i have no idea how i have to do that. because if i Google i only get results on how to use and string array to populate the list.
my parser:
TextView txt =(TextView)vi.findViewById(R.id.tv);
HashMap<String, String> song = new HashMap<String, String>();
song = data.get(position);
txt.setText(song.get(MainActivity.KEY_TXT));
the method i use (so far) for getting my string array:
private String[] txt = {
}
thanks in advance.
You just have to use the string array in getView() method of listView adapter. like this:–
give the size of strArray same as the size of listView.
now u want to use this strArray to other class then either you have to make it static or you could pass this to other class via
intent.like this:–and then in other
activity classYou should get this String array by putting this code:–and if the class to whom you want to pass the String Array( that is strArray) is not
Activitythen You should make your strArray static like this:now i think your problem will be solved..