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

  • Home
  • SEARCH
  • 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 8851709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:13:17+00:00 2026-06-14T13:13:17+00:00

OK, I’ve got a quite complex little setup here. My main activity is a

  • 0

OK, I’ve got a quite complex little setup here. My main activity is a TabHost, and one of those tabs displays some text, a button, and then a ListView. For some reason, the ListView will only show 1 item. When I add more items, only the first one in the list shows.

tabmenu.xml:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:configChanges="orientation|keyboardHidden|screenSize">
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/tabhost" android:layout_width="fill_parent"
         android:layout_height="wrap_content">
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:orientation="vertical">
        <TabWidget
                android:id="@android:id/tabs"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="bottom"
                android:scrollbarStyle="outsideInset"
                android:scrollbars="horizontal"/>
        <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="fill_parent" android:layout_height="fill_parent">
            <include layout="@layout/main"/>
            <include layout="@layout/scheduler"/>
        </FrameLayout>
    </LinearLayout>
</TabHost>
</ScrollView>

Scheduler.xml: (This is where the listview is)

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/schedulerLayout">

<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_alignParentTop ="true"
        android:gravity="center"
        android:paddingBottom="20dp"
        android:id="@+id/timeLayout">
    <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/currentHours"
            android:textSize="50dp"/>
    <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="50dp"
            android:text=":"/>
    <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/currentMinutes"
            android:textSize="50dp"/>
    <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:gravity="center_vertical"
            android:orientation="vertical">
        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>
        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/ampm"/>
    </LinearLayout>
    <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:gravity="center_vertical"
            android:paddingLeft="10dp"
            android:orientation="vertical">
        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/currentDayOfWeek"/>
        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/currentDate"/>
    </LinearLayout>
</LinearLayout>

<Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/scheduleButton"
        android:text="@string/newSchedule"
        android:layout_below="@id/timeLayout"/>
<!--android:enabled="false"-->

<LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/scheduleButton"
        android:paddingTop="5dp"
        android:orientation="vertical">
    <View
            android:layout_width="fill_parent"
            android:layout_height="2dip"
            android:background="#FFFFFFFF"/>

    <ListView
            android:id="@+id/scheduler_list_view"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"/>
    <!--                android:focusable="false"
            android:focusableInTouchMode="false"-->
</LinearLayout>

</RelativeLayout>

Main.java:

//adds tabs to view
spec = tabHost.newTabSpec("Auto Respond")
        .setIndicator(" Auto Respond ")
        .setContent(R.id.mainLayout);

tabHost.addTab(spec);

spec = tabHost.newTabSpec("Scheduler")
        .setIndicator(" Scheduler ")
        .setContent(R.id.schedulerLayout);


tabHost.addTab(spec);
tabHost.getTabWidget();


//start setup of list display
int number = 0;
ArrayList<HashMap<String, ?>> data = new ArrayList<HashMap<String, ?>>();
HashMap<String, Object> row  = new HashMap<String, Object>();

//gets number of items, gets title, startTime, etc. here (lots of code, so I cut it out)

if(curTitle != null && !curTitle.equals(""))
{
    row  = new HashMap<String, Object>();

    row.put("Title", curTitle);
    row.put("Time", time);
    row.put("Day", dayText);
    row.put("Month", monthText);
    data.add(row);
}

//create list
SimpleAdapter adapter = new SimpleAdapter(this,
        data,
        R.layout.schedulerow,
        new String[] {"Title","Time","Day", "Month"},
        new int[] { R.id.scheduleListTitle, R.id.scheduleListTime,R.id.scheduleListDays, R.id.scheduleListMonths});

listview.setAdapter(adapter);

Any ideas as to why it only shows the first item in my ListView? I tried simply changing Activity to ListActivity and it FC’d. I don’t really want to re-do all of my code to make it work as a ListActivity, so I want to keep it as Activity if possible.

  • 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-06-14T13:13:18+00:00Added an answer on June 14, 2026 at 1:13 pm

    You are trying to display a lot of information and you have nested your ListView in a ScrollView… Do you have to scroll to see the ListView?

    Nesting two scrollable Views usually doesn’t work because, in this case, the ListView consumes the gestures preventing the ScrollView from scrolling which in turn prevents you from seeing the entire ListView.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm making a simple page using Google Maps API 3. My first. One marker

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.