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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:20:10+00:00 2026-05-30T00:20:10+00:00

Using this I tried to create a custom ListAdapter that would simply add all

  • 0

Using this I tried to create a custom ListAdapter that would simply add all my records as CheckBoxes. Even though I can see during debug that the adapter contains all 4 expected records and the override int Count method returns 4 and the override View GetView iterates through 4 times, the position variable always = 0 and only 1 CheckBox containing the first record actually shows up.

ListView row layout xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
  <CheckBox
    android:id="@+id/checkItem"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"/>
</LinearLayout>

CallManager.axml

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
  <RelativeLayout
    android:id="@+id/container"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
      android:id="@+id/equipLayout"
      android:tag="equip"
      android:layout_width="fill_parent"
      android:orientation="horizontal"
      android:layout_height="fill_parent"
      android:layout_below="@id/place4"
      android:layout_margin="8dip"
      android:visibility="gone">
     <ListView
      android:id="@+id/equipLV"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"></ListView>
   </LinearLayout>
</RelativeLayout>
</ScrollView>

//There are several other nested LinearLayouts which is why I have the ScrollView and RelativeLayouts. Not relevant so left out for cleanliness.

CallManagement.cs

public class CallManagement : Activity
{      
    CustomListAdapter listAdapter;

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        SetContentView(Resource.Layout.CallManager);

        ListView equipLV = (ListView)FindViewById(Resource.Id.equipLV);
        listAdapter = new CustomListAdapter(this, callNumber.Substring(0,10));
        equipLV.Adapter = listAdapter;

}

Custom ListAdapter class

public class CustomListAdapter : BaseAdapter
{
    Activity context;
    External inst;

    public List<equip> equip;

    public CustomListAdapter(Activity context, string callNumber)
        :base()
    {
        inst = new External();
        this.context = context;
        this.equip = new List<equip>();
        this.equip = inst.popEquipLV().ToList();                            
    }

    public override int  Count
    {
        get { return equip.Count; }
    }

    public override Java.Lang.Object  GetItem(int position)
    {
        return position;
    }

    public override long  GetItemId(int position)
    {
        return position;
    }

    public override View  GetView(int position, View convertView, ViewGroup parent)
    {
        var item = equip[position];
        var view = (convertView ?? 
            context.LayoutInflater.Inflate(Resource.Layout.equipLVitem, parent, false)) as LinearLayout;

        CheckBox checkItem = (CheckBox)view.FindViewById(Resource.Id.checkItem);
        checkItem.Tag = GetItemAtPosition(position).unit.ToString();
        checkItem.Text = GetItemAtPosition(position).serial.ToString();

        return view;
    }

    public equip GetItemAtPosition(int position)
    {
        return equip[position];
    }

}
  • 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-30T00:20:11+00:00Added an answer on May 30, 2026 at 12:20 am

    You don’t ever want to put a ListView inside of a ScrollView. That’s probably the problem.

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

Sidebar

Related Questions

I want to create multilevel accordion Navigation using jQuery , I tried using this
I would like to create a custom task that is called in a fashion
I need a custom widget height. I tried using this Integer.toString(yourWidget.getElement().getOffsetHeight()) but, If I
i've tried using this code and this to make a random quote generator, but
Can someone show me how to use the System.Numerics.BigInteger datatype? I tried using this
I tried to send an email using this class below, but no success, no
Using PyCrypto (although I've tried this in ObjC with OpenSSL bindings as well) :
I tried this aproach without any success the code I'm using: // File name
How can I upload files to server using JSP/Servlet? I tried this: <form action="upload"
I tried using height: 100% but this makes the div only as high as

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.