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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:08:04+00:00 2026-05-28T08:08:04+00:00

I am trying to define a composite list item in an Android ListView but

  • 0

I am trying to define a composite list item in an Android ListView but it seems to be overly complex. (By this I mean where I compose each item in the listview from multiple views/controls)

In Xaml this is very simple and clean. Yes, I know undfortunately Android does not support binding but I am looking for the best way to accomplish this in Android.

XAML example:

<ListBox ItemsSource="{Binding Days}" x:Name="DataList">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <StackPanel>
                <TextBlock Text="{Binding DateString}" x:Name="DateBox" />
                <TextBlock Text="{Binding Name}" x:Name="NameBox"/>
            </StackPanel>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

If you know Xaml, then there is no code to make the binding work other then setting the VM as the DataContext and exposing the bound items as public properties.

As far as I can tell, there is a lot of work to make this happen in Android. I need to create a custom ListAdapter, lots of wiring and overriding, etc. Is there a better way to do this?

Can someone please point me to docs/tutorial that demonstrates the best practices for solving this problem in Android.

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-28T08:08:05+00:00Added an answer on May 28, 2026 at 8:08 am

    In this case, yes there’s more code to write than if you had done it in WPF. The equivalent of defining a DataTemplate on an ItemsControl in WPF is making a custom Adapter and implementing the getView method.

    The World of ListView video is a must watch for understanding best practices with Adapters.

    http://www.youtube.com/watch?v=wDBM6wVEO70

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

Sidebar

Related Questions

I'm trying to define an action for a model Bar -- but I only
I'm trying to define a predicate where it searches a list of lists for
I'm trying to define an infix operator but I keep getting errors. I'm using
I trying to define a function in sybase. I write this script: CREATE FUNCTION
When trying to define an array such this: $array = new SPLFixedArray(256); for ($i
I'm trying to define multiple criteria for a single field in symfony, but every
I'm trying to define a custom formatter for my class, but I can't find
I was trying to: #define CommonAppData {commonappdata} but it yields: Compiler Error [ISPP] Expression
I'm trying to define attributes from an array like so: [a, b, c].each do
I'm trying to define the inheritance-check predicate is_a/2 in Prolog, but so far all

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.