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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:04:38+00:00 2026-05-26T02:04:38+00:00

This is a great tutorial on how to get a Single Choice List in

  • 0

This is a great tutorial on how to get a Single Choice List in Android to work, but I need one more thing: I want two lines of text instead of one. So, it would look like this:

|-----------------------------|
| FIRST LINE OF TEXT      (o) | <- this is a "RadioButton". Ideally, 
| second line of text         |    it would be centered vertically.
|-----------------------------|

This SO question is related, but I’m an Android newb, so it’s a little over my head. Can anyone break it down for me so that I can use it in the context of the tutorial I linked above?

  • 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-26T02:04:38+00:00Added an answer on May 26, 2026 at 2:04 am

    You need to create the custom layout for this.

    for display list as it like

    this is your layout file

    <LinearLayout
         android:orientation="vertical"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent">
    
       <ListView 
         android:id="@+id/mylistview"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent" />
    </LinearLayout>
    

    this is your custom list view style

    <LinearLayout
         android:orientation="horizontal"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent">
             <LinearLayout
                  android:layout_weight="1"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:orientation="vertical">
                  <TextView
                         android:id="@+id/text1"
                         android:layout_width="fill_parent"
                         android:layout_height="wrap_content"
                         android:text="Text view 1"/>
                  <TextView
                         android:id="@+id/text2"
                         android:layout_width="fill_parent"
                         android:layout_height="wrap_content"
                         android:text="Text view 2"/>
            </LinearLayout>
            <RadioButton android:id="@+id/radiobtn" 
            android:width="wrap_content" android:height="wrap_content" />
    </LinearLayout>
    

    now you have to implement any adapter like BaseAdapter,ArrayAdapter etc.

    and use this custom list view in that

    like this way

    private class CustomAdapter extends ArrayAdapter<Order> {
    
            private ArrayList<Model> items;
    
            public OrderAdapter(Context context, int textViewResourceId, ArrayList<Model> items) {
                    super(context, textViewResourceId, items);
                    this.items = items;
            }
    
            @Override
            public View getView(int position, View convertView, ViewGroup parent) {
                    View v = convertView;
                    if (v == null) {
                        LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                        v = vi.inflate(R.layout.custom_list, null); // here you have to implement custom_list.xml file
                    }
                    Model m = items.get(position);
                    if (m != null) {
                            TextView text1 = (TextView) v.findViewById(R.id.text1);
                            TextView text2 = (TextView) v.findViewById(R.id.text2);
                            RadioButton rb = (RadioButton) v.findViewById(R.id.radiobtn);
                            text1.setText(m.text1);
                            text1.setText(m.text2);
                            rb.setChecked(m.isChecked);
                    }
                    return v;
            }
    }
    

    here is your Model class for your list item

    private class Model{
        String text1;
        String text2;
        boolean isChecked;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just found this great tutorial as it is something that I need.
I found this great Tablesorter plugin for jQuery but I can't make it work
I have this working great, but I'd like a deeper understanding of what is
well, this works great on a non Windows Mobile: string user = WindowsIdentity.GetCurrent().Name.ToString(); but,
I found a great tutorial on performing a faceted search. http://www.devatwork.nl/articles/lucenenet/faceted-search-and-drill-down-lucenenet/ This article does
this website gives a great example of how to get all the data stored
I have found this great tutorial, about uploading files with a Flex app, using
Ever stumbled on a tutorial that you feel is of great value but not
I'm trying to do a tutorial. I did one tutorial and things were great.
I just started getting into node.js and followed this great tutorial on node.js at

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.