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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:14:01+00:00 2026-05-26T03:14:01+00:00

I want to make a menu, which contains 4 different LinearLayouts. Top one has

  • 0

I want to make a menu, which contains 4 different LinearLayouts.
Top one has title, second one has description, the third one has 3 ImageViews, which have event onClick, and the fourth one has a Button which also has onClick event.

Somehow, android doesn’t like it, and forcing me to use ListView.

The exception message is: java.lang.RuntimeException: Your content must have a ListView whose id attribute is ‘android.R.id.list’

I have already tried to use ListView, and it didn’t work as I expected. For example, the 3rd layout, which has 3 buttons, the events are not working for each ImageView, but instead on the row of the ListView.

What can be done?

Displaying my layouts xml files:

options.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:id="@+id/optionsLayout"
    android:background="@drawable/bg" android:layout_gravity="center">

    <include  layout="@layout/options_layout1" android:id="@+id/optionsLayout1" />
    <include  layout="@layout/options_layout2" android:id="@+id/optionsLayout2" />
    <include  layout="@layout/options_layout3" android:id="@+id/optionsLayout3" />
    <include  layout="@layout/options_layout4" android:id="@+id/optionsLayout4" />

</LinearLayout>

options_layout1.xml

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:id="@+id/optionsTitleLayout"
    android:background="@drawable/options" 
    android:layout_gravity="center" />

options_layout2.xml

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:id="@+id/chooseThemeTitleLayout"
    android:background="@drawable/choose_theme" android:layout_gravity="center" 
    android:layout_marginTop="70dip" />

options_layout3.xml

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:id="@+id/optionButtonsLayout" 
    android:layout_gravity="center" android:layout_marginTop="10dip" >
    <ImageView android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:id="@+id/theme1Btn"
        android:background="@drawable/theme1_off" android:layout_marginLeft="10dip" 
        android:layout_marginRight="10dip" />
    <ImageView android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_centerInParent="true"
        android:id="@+id/theme2Btn" android:background="@drawable/theme2_off" 
        android:layout_marginLeft="10dip" android:layout_marginRight="10dip" />
    <ImageView android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_toRightOf="@id/theme2Btn"
        android:id="@+id/theme3Btn" android:background="@drawable/theme3_off" 
        android:layout_marginLeft="10dip" android:layout_marginRight="10dip"/>
</LinearLayout>

options_layout4.xml

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:id="@+id/saveButtonLayout"
    android:layout_gravity="center" >
    <Button android:id="@+id/saveBtn" android:layout_width="wrap_content"
        android:layout_height="wrap_content" android:layout_centerHorizontal="true"
        android:text="Save" android:layout_marginTop="10dip"/>
</LinearLayout>

Thanks,
Henry.

  • 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-26T03:14:02+00:00Added an answer on May 26, 2026 at 3:14 am

    The problem is not the xml, the problem is somewhere in the code. You use a specific class which expects an ID R.id.list to be in your layout. Probably your Activity still extends ListActivity? This Activity needs an R.id.list in it’s layout.

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

Sidebar

Related Questions

I want to make a dropdown menu like delicious has at this http://delicious.com/search?context=all&p=sql&lc=1 page.
I need this because I want to make a menu (which is made from
I want to make a right click menu for my winforms app. It will
I want to make my own Start Menu replacement and I am trying to
I want to make a WPF Window that behaves like a context menu. So,
I'am new to Drupal, i just want to create a website which contains pages
My first post here. I want to make a horizontal menu with submenu's sliding
I need a dropdown menu <select> which contains multiple checkboxes. so people can drop
I have made a navbar at the top of my website which contains multiple
I want to make a global social network, in which users can search for

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.