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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:51:55+00:00 2026-05-26T04:51:55+00:00

I have an ArrayList<myObject> and a ListView with a personal ArrayAdapter<myObject> using an inflated

  • 0

I have an ArrayList<myObject> and a ListView with a personal ArrayAdapter<myObject> using an inflated View that generates a list of Buttons.

It works, but one button per line is quite layout consuming ^^

I wanted to know if it was possible to display two or more items (Button) per line and how to do such a thing ?

I thought about dividing my items in two lists (even and odd) but they’ll have to scroll all-together for a better user experience…

any idea ? or object that already implements it ?

Thanks

  • 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-26T04:51:56+00:00Added an answer on May 26, 2026 at 4:51 am

    For that case, just take a GridView with 2 columns, i am sure this will fulfill your requirement.

    gridview_row.xml

        <Button 
            android:text="Button" 
            android:id="@+id/button1" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content">
        </Button>
    
    </LinearLayout>
    

    and take GridView instad of ListView as:

     <GridView 
            android:id="@+id/gridview01" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:numColumns="2"
            android:horizontalSpacing="5dp"
            android:verticalSpacing="5dp">
    
     </GridView>
    

    Once you are done with these 2 things, then implement the code in your custom adapter. And i am sure your current adapter is also 90% useful, you just need to change the code according the row xml file.

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

Sidebar

Related Questions

I have an ArrayList<String> that I'd like to return a copy of. ArrayList has
I have an arraylist that contains items called Room. Each Room has a roomtype
I have an arraylist that gets different type of values in it, 1st value->
I have an ArrayList that I want to use to hold RaceCar objects that
I have an arraylist namelist in my model and in my view I need
I have an application that uses a service to create an ArrayList of custom
I have a list that gets refreshed every 2 seconds via the Handler postDelayed()
I have a spring MVC application using JSP as my view technologies with Jquery
I have tried several different ways, but it seems that it never sends the
I have an ArrayList of objects that have a name and an icon pointer

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.