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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:43:11+00:00 2026-05-25T12:43:11+00:00

I have a listview which is simply populated this way: setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_multiple_choice, aux))

  • 0

I have a listview which is simply populated this way:

setListAdapter(new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_multiple_choice, aux))

‘aux’ it’s static String[] aux = null;which is populated via Web Service.

I made a theme and tested with static listview elements, file lista.xml -> you can see it here (if you look in the bottom you will see I put “list item 1, list item 2”, so I need to populate those values dinamically…)

My question is, how can I apply the theme to my listadapter?

I believe I start with :

setListAdapter(new ArrayAdapter(this,
R.layout.lista, aux))

But I have two problems.

(1) I dont know how to work with XML and populating from java (setlistadapter)
(2) I believe I will lose checkboxes.

However I appreciate if anyone can help in (1) first 🙂 I really don’t know what am doing now!

  • 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-25T12:43:11+00:00Added an answer on May 25, 2026 at 12:43 pm
    setListAdapter(new ArrayAdapter(this, R.layout.lista, aux))
    

    is the start, you are right, but when you want a custom ListItem Layout you have to write a custom ListAdapter. You extend ArrayAdapter<YourItemClass> for example. There you override the method getView() and in this method you populate your custom Layout with your Values of your Aux Objects.

    for an ArrayAdapter you have to set a id in your layout for your listview items

    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:id="@+id/textview" android:layout_weight="1">
    
    </TextView>
    

    with id/textview you say your listAdapter to render into this View.

    edit: oh and you have to learn and obey the holder concept of Lists. here: How to load the Listview "smoothly" in android

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

Sidebar

Related Questions

I have a simple listview and listadapter setup as follows: listAdapter = new ArrayAdapter<MyDomainObject>(this,
I have a ListView which is populated from a string-array resource. I'm trying to
This is a very common scenario: displaying images in a ListView which have to
I have a dynamic ListView which uses an ArrayAdapter . When a name is
I have a simple 3-column ListView. This control is programatically populated with data from
I have an Android activity in which I have a ListView bound to a
I have a ListView which sometimes I need to put around 10000 items in.
I have a ListView which is using a GridView to display a DataTable and
I have a listview which has its datasource changed after update of a search
I have a WPF ListView which repeats the data vertically. I cannot figure out

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.