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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:08:53+00:00 2026-05-23T17:08:53+00:00

All I’m looking to do, is have a ListView with a textView and EITHER

  • 0

All I’m looking to do, is have a ListView with a textView and EITHER a spinner on the right side or a check box.
I’m having so much difficulty with this it’s ridiculous. Can anyone help me please? :(.

Here’s what i have so far that implements a spinner by itself. (I created R.array for planets. so it does work.)

public class AlarmOptions extends Activity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main2);

        Spinner mySpinner = (Spinner) findViewById(R.id.spinner);
        ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.planets, android.R.layout.simple_spinner_item);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        mySpinner.setAdapter(adapter);
        Spinner mySpinner1 = (Spinner) findViewById(R.id.spinner1);
        ArrayAdapter adapter1 = ArrayAdapter.createFromResource(this, R.array.planets1, android.R.layout.simple_spinner_item);
        adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        mySpinner1.setAdapter(adapter1);
    }

Here is the XML file main2.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:padding="10dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content">

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:text="Please select a planet:"
/>

<Spinner 
android:id="@+id/spinner"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:prompt="@string/planet_prompt"
/>
<Spinner 
android:id="@+id/spinner1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:prompt="@string/planet_prompt1"
/>

</LinearLayout>

PLEASE HELP :'(

  • 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-23T17:08:53+00:00Added an answer on May 23, 2026 at 5:08 pm

    What you could do is: Create a list view like normal. Then create a separate xml file with the layout your would like for each item in the list view. This would work for both the spinner and the checkbox and is simple and easy to create.

    Please consider:

    <...xml header stuff .../>
    
    <LinearLayout android:id="@+id/ll"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    
        <Spinner (or Checkbox) android:id="@+id/spinny"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
        <TextView android:id="@+is/texty"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>
    </LinearLayout>
    

    And then for your activity you would create a ListView just like you normally would. inflating this layout for each ListView item in the getView(...args...) method of the ListView adapter.

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

Sidebar

Related Questions

All, I have the following class so to check to see if the form
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
All the articles I've found via google are either obsolete or contradict one another.
All the recent VisualSVN Server posts made me want to check it out. I
All, I currently have two projects that are under SourceSafe that I am unable
All I am looking for the best free set of tools to be used
All, I am trying to ensure that a file I have open with BufferedReader
All, I have the following array in array format. The JSON format is shown
All, I have some script tags that are not working in Wordpress. If I
All, Say I have the following bit of code: select: function(start, end, allDay) {

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.