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

  • SEARCH
  • Home
  • 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 6909949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:45:13+00:00 2026-05-27T08:45:13+00:00

I have a layout defined with some buttons, and a ListView widget. I also

  • 0

I have a layout defined with some buttons, and a ListView widget. I also have a layout xml defined for each row in the ListView, with 2 TextViews. I also have data in the format List<String[]> where the String[] is populated with 3 items. I want to display the data in the ListView, with 2 of the 3 items from the String array (contained in each element of the list) assigned to one of the TextView rows in the ListView layout.

I can get a ListView, using one of the default views, to display the full list of just a single item in the array, by breaking it down into a single array of values, and using ArrayAdapter<String>, but I dont know how to do it for multiple rows in the ListView layout.

Would much appreciate any help.

Also, in addition, if the data in the original List<String[]> list should change, how can I refresh the ListView widget?

Thanks for any advice.

  • 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-05-27T08:45:13+00:00Added an answer on May 27, 2026 at 8:45 am

    You should create your own extension of the ArrayAdapter:

    class MyAdapter extends ArrayAdapter<String[]>{
            public MyAdapter(Context context, int textViewResourceId, ArrayList<String[]> objects) {
                super(context, textViewResourceId, objects);
            }
    
            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
                if( convertView== null ) convertView = getLayoutInflater().inflate(R.layout.your_layout, null);
    
                String[] strings = getItem(position);
                TextView line1 = (TextView)convertView.findViewById(R.id.line1);
                line1.setText(strings[0])
                TextView line2 = (TextView)convertView.findViewById(R.id.line2);
                line2.setText(strings[0])
                //...
    
                return convertView;
            }
        }
    

    To refresh your list, call the adapters notifyDataSetChanged() method.

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

Sidebar

Related Questions

I have a layout defined in XML. It contains also: <RelativeLayout android:id=@+id/item android:layout_width=fill_parent android:layout_height=wrap_content
I have a listView with custom objects defined by the xml-layout below. I want
I have the following layout defined for one of my Activities: <?xml version=1.0 encoding=utf-8?>
I have some layout/button and onClick I get TimePickerDialog with current time (previously defined
I have a custom SurfaceView defined in my layout xml. I can draw to
I have a border layout whose center panel is defined like the below. {
I have a layout as follows: <div style=width: 300> <div style=width: 300>Some Content</div> </div
I am having some trouble with using h:selectOneRadio . I have a list of
I am creating some views in my xml file, xml file contaings list-view. In
I have created a Generic WPF Control, so the layout is all defined in

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.