Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8746945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:16:34+00:00 2026-06-13T12:16:34+00:00

i have a xml parser with lazy adapter, i parse all the data to

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:16:34+00:00Added an answer on June 13, 2026 at 12:16 pm

    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.

    String strArray[] = new String[<size of Your ListView>]; 
    
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
    
    
        TextView textView;
        if (convertView == null) {
    
            convertView = inflater.inflate(R.layout.listitem, parent, false);
            textView = (TextView) convertView
                    .findViewById(R.id.textView);
        }
        strArray[position] = textView.getText().toString();
        return convertView;
    }
    

    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:–

    Bundle b=new Bundle();
    b.putStringArray(key, new String[]{value1, value2});
    Intent i=new Intent(context, Class);
    i.putExtras(b);
    

    and then in other activity class You should get this String array by putting this code:–

    Bundle b=this.getIntent().getExtras();
    String[] array=b.getStringArray(key);
    

    and if the class to whom you want to pass the String Array( that is strArray) is not Activity then You should make your strArray static like this:

    public static strArray[];
    

    now i think your problem will be solved..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a XML parser that list correctly in the UITableViewController. It passes
I have student.xml file and am parsing this file using SAX Parser and now
I have a problem with using the SAX parser to parse a XML file.
please help me to parse xml from another xml... i have this xml named
I have an xml feed at this url Now im trying parse the content,
I am using XML parser.In that i have to pass one id from one
I have XML data that looks like this <?xml version=1.0 encoding=utf-8?> <root> <account var1=
I have a XML parser which will parse 17 different XML documents (I'm simplifying
Possible Duplicate: Best XML Parser for PHP I have an XML code like as
I have created and XML parser that acquires the data in the description tag.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.