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 8782091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:28:38+00:00 2026-06-13T20:28:38+00:00

I have a question that I would love to get an answer on. I

  • 0

I have a question that I would love to get an answer on.

I have two arrays, let’s say:

String[] name = {"Name Nameson", "Second Name"};
String[] number = {"111 11 111", "222 22 222"};

I want my ListView to have two TextViews into one item.(I tried to illustrate this with a picture).

I manage to get f.ex. my name array into the listview with a simple

lv.setAdapter(new ArrayAdapter<String>(this, R.layout.single_name, name));

I have my main.xml with my ListView in it, single_name.xml and single_number.xml in my layout-folder.

Since I’m new to this site I’m not allowed to add a picture, I will try to illustrate it here:


HEADER


(item one)

Name Nameson

111 11 111


(item two)

Second Name

222 22 222


And this continues depending on quantity of contacts.

Any help would be greatly appreciated 🙂

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-13T20:28:39+00:00Added an answer on June 13, 2026 at 8:28 pm

    You will need to build a custom Adapter as well a custom view to represent each row in your List.

    Here’s an example of a simple adapter for a listview with 2 textviews and an imageview. Modify as you see fit to include your header and take out the imageview

    package com.aquarius.customlistviewproject;
    
    
    public class CustomListViewAdapter extends BaseAdapter{
    
    
     private ArrayList<String> album_names;
    
    private ArrayList<String> num_photos;
    
     public Activity context;
    
    public LayoutInflater inflater;
    
     public CustomListViewAdapter(Activity context, ArrayList<String> album_names ,     ArrayList<String> num_photos){
    
    super();
    this.album_names = album_names;
    this.num_photos = num_photos;
    this.context = context;
    this.inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
    }
    
    
    public Object getItem(int position) {
        // TODO Auto-generated method stub
        return null;
    }
    
    public long getItemId(int position) {
        // TODO Auto-generated method stub
        return 0;
    }
    
    public int getCount() {
        // TODO Auto-generated method stub
        return album_names.size();
    }
    
    public class ViewHolder{
    
        ImageView thumbnail;
        TextView  title;
        TextView photos;
    }
    
    public View getView(int position, View convertView, ViewGroup parent) {
    
        ViewHolder holder;
    
        if(convertView == null){
            holder = new ViewHolder();
            convertView = inflater.inflate(R.layout.listview_row, null);
    
            holder.thumbnail = (ImageView)convertView.findViewById(R.id.imgViewLogo);
            holder.title = (TextView)convertView.findViewById(R.id.txtViewTitle);
            holder.photos = (TextView)convertView.findViewById(R.id.txtViewDescription);
    
    
            convertView.setTag(holder);
        }
    
        else
            holder = (ViewHolder)convertView.getTag();
            holder.thumbnail.setImageResource(R.drawable.imgview_drawable);
    
            holder.title.setText(album_names.get(position));
            holder.photos.setText(num_photos.get(position));
        return convertView;
    }
    

    }

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

Sidebar

Related Questions

I would dearly love to get rid of the hideous EDMX blob that we
I have a question that should be quick and easy for you guys to
I have a question that may be quite naive, but I feel the need
I have a question that I just don't feel like I've found a satisfactory
I have a question that I'm ashamed to ask, but I'm going to have
I have a question that may sound odd, but being somewhat of a newbie,
I have a question that can I use AS400ConnectionPool in Spring if then pls
I have a question that's somewhat of an extension of this thread . I
I have a quick question that I can't seem to find online. I am
I have a SQL question that i need to ask the experts. To be

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.