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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:14:43+00:00 2026-05-23T19:14:43+00:00

I was following the ListView official tutorial – [url]http://developer.android.com/resources/tutorials/views/hello-listview.html[/url], because I get the entries

  • 0

I was following the ListView official tutorial – [url]http://developer.android.com/resources/tutorials/views/hello-listview.html[/url], because I get the entries dinamically through a webservice.

Problem is, I want to place checkboxes at it. I have this

(aux (String [] aux) is previously and correctly fullfilled before this)

//setListAdapter(new ArrayAdapter<String>(this, R.layout.lista, aux));
        setListAdapter(new ArrayAdapter<CheckBox>(this,R.layout.row, convertToListItem(aux)));

        //ListView lv = getListView();
        //lv.setTextFilterEnabled(true);

And I think the problem is on my row.xml

<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content" android:layout_height="wrap_content"
    android:textSize="14sp" android:typeface="normal" android:textStyle="normal"

    android:layout_weight="0" android:layout_gravity="left" />

or in this function

private List<CheckBox> convertToListItem(String[] aux2){

        List<CheckBox> result = new ArrayList<CheckBox>();  
        ArrayList<CheckBox> boxes = new ArrayList<CheckBox>();

        for (String text : aux2){
            CheckBox temp = new CheckBox(this);
            temp.append(text);
            temp.setText(text,BufferType.NORMAL);
            result.add(temp);
            boxes.add(temp);

        }

        return result;

What happens is: it appears the checkbox, but in front instead the right text it appears “android.widget.Checkbox@….”

What am I doing wrong ?

  • 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-23T19:14:44+00:00Added an answer on May 23, 2026 at 7:14 pm

    You have to implement your own Adapter extending ArrayAdapter and put a TextView in your row.xml

    Then you must handle your view from getView() method.

    Let me know if this helps, if not, please can you add more info about what you need/want a more code for sure.

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

Sidebar

Related Questions

Android:How to display images from the web in a ListView?I have the following code
Following the Android sample for populating a ListView , I query an array from
Here is the problem: I have a ListView as following: <UserControl.Resources> <DataTemplate x:Key="FirstCell"> <StackPanel
Using the following to populate my ListView with checkbox-supported list: setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_checked, new
I have the following ClickListener: itemList=(ListView)findViewById(android.R.id.list); itemList.setTextFilterEnabled(true); itemList.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?>
I have a listview which displays emails with the following layout: email@address.com category //This
Possible Duplicate: Andriod: Inflate listview using its android:id With regard to the following qn
I have the following HTML: <div class='sidebar-listview ui-listview' data-role='listview' data-theme='c'> <li class='ui-li ui-li-static ui-body-c
I've following ListView Item (in a WPF Form): <ListView Name=listViewTeam ItemsSource={Binding Path=TeamList}> <ListView.View> <GridView
I have the following ListView in which I am using the JQuery UI sortable

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.