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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:07:14+00:00 2026-06-01T16:07:14+00:00

I have a Layout which contains a textview and editText on the top, then

  • 0

I have a Layout which contains a textview and editText on the top, then after a listView and at the bottom i have 4 buttons.

I want my listview items to contain a imageView and 4 textViews.

I have the main layout with all the views in the 1st statement and a seperate list_item.xml (linear layout) which contains all the elements (imageview and 4 textviews) which each listview item must contain.

How can I populate the listview in my main layout with list_item.xml layout.

  1. I have populated a listview using a list_item.xml which contains only TextView tag (not a linear or relative layout).

  2. I also populated some other listview using a custom array adapter, but here the main layout contains only the list view item layout but not the top textview and edit view and bottom 4 buttons.

I think my problem is a combination of both point1 and point2. can anyone explain how to achieve this?

  • 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-01T16:07:15+00:00Added an answer on June 1, 2026 at 4:07 pm

    You need to implement a custom adapter like this…

      private class myAdapter extends ArrayAdapter<yourclass> {
    
        private ArrayList<yourclass> items;
    
        public myAdapter(Context context, int textViewResourceId, ArrayList<yourclass> items) {
                super(context, textViewResourceId, items);
                this.items = items;
        }
    
        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
                View v = convertView;
                if (v == null) {
                    LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                    v = vi.inflate(R.layout.list_item, null);
                }
                yourclass o = items.get(position);
                if (o != null) {
                        TextView tt = (TextView) v.findViewById(R.id.txt1);
                        TextView bt = (TextView) v.findViewById(R.id.txt2);
            //similarly for 2 more textviews and a imageview
                        if (tt != null) {
                              tt.setText("Name: "+o.getitemName());                            }
                        if(bt != null){
                              bt.setText("Status: "+ o.getitemStatus());
                 //similarly...and getitemName ,getitemStatus are functions of your class.. to get the values..
                        }
                }
                return v;
        }
    

    }

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

Sidebar

Related Questions

I want to create a layout which contains TextView , Button and ListView here
I have a layout which contains some views like this: <LinearLayout> <TextView...> <TextView...> <ImageView
I have a Tab that has a custom layout which contains a TextView .
I have a ListView in which each item has a complex layout that contains,
I have android app in which one layout contains Linearlayout , ScrollView , TextView
I have a layout which contains button and textView with visibility=gone. This layout is
I have a ListView which contains an ImageView and a TextView. I'm subclassing ArrayAdapter
I have an xml layout which I use for each row in my listview:
Hallo all, I have a ListView which contains a Button in each line. The
I have a RelativeLayout defined in an xml layout file named 'myview.xml' which contains

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.