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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:29:41+00:00 2026-06-08T06:29:41+00:00

I had a list with one column which worked with an adapter, and it

  • 0

I had a list with one column which worked with an adapter, and it worked. Now I am trying to make it into two columns, and I am getting exceptions.

I am following this tutorial which seems to be the simplest: http://www.heikkitoivonen.net/blog/2009/02/15/multicolumn-listview-in-android/

I have a Java Activity that I declare like this:

public class SeeAllQuestionsActivity extends ListActivity

and here is a bit of code:

@Override
public void onCreate(Bundle savedInstanceState) 
{
super.onCreate(savedInstanceState);
    FlurryAgent.onStartSession(this, "8CA5LTZ5M73EG8R35SXG");

    setContentView(R.layout.all_question_page);
...

Here is the all_question_page 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:padding="3px"
        >

<include android:id="@+id/header"
         layout="@layout/header"
         android:layout_height="wrap_content"
         android:layout_width="fill_parent"/>    

<TextView
    android:id="@+id/loading_questions" 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Some prompt text."
    android:textSize="10sp"
    />

    <ListView
        android:id="@+id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:text="@+id/label"
        android:textSize="20px" >        
    </ListView>
</LinearLayout>

By the way, if someone can explain to me the diffrence between two syntaxes for referencing the list id, it would be great:

  android:id="@android:id/list"  
  android:id="@+id/list"  

FYI, neither of these is working for me 🙂

And here is the questions_list.xml layout

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:paddingTop="4dip"
     android:paddingBottom="6dip"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal">

     <TextView android:id="@+id/TRAIN_CELL"
         android:layout_width="50dip"
         android:layout_height="wrap_content"/>

     <TextView android:id="@+id/FROM_CELL"
         android:layout_width="70dip"
         android:layout_height="wrap_content" android:layout_weight="1"/>

     <TextView android:id="@+id/TO_CELL"
         android:layout_width="60dip"
         android:layout_height="wrap_content"  android:layout_weight="1"/>
</LinearLayout>

When I run this on the simulator, it crashes with a runtime exception complaining about this line: setContentView(R.layout.all_question_page); and the error is:

 java.lang.RuntimeException: 
Your content must have a ListView whose id attribute is 'android.R.id.list'

Please help, I am pretty stuck

Thank you!!

  • 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-08T06:29:44+00:00Added an answer on June 8, 2026 at 6:29 am

    The difference seems to be that the former is what you’d need to use in order to use a ListActivity and the latter is what you’d use if you weren’t going to use ListActivity, but instead just a normal Activity. So you’ll have to stick with. (Note: I’ve never personally used ListActivity, so I can’t exactly vouch for this)

    android:id="@android:id/list" 
    

    I would also suggest removing these too lines from your ListView:

    android:text="@+id/label"
    android:textSize="20px"
    

    Neither text, nor textSize are valid attributes of ListView. And for any widget that text is a valid attribute of I don’t think you’d ever want to set the text equal to something like "@+id/label". If you are trying to reference a string from your strings.xml file you’d need to use "@string/label". Referencing an id like that for the text will put some hex code into the text that will have no meaning to the user(if it works at all).

    It is possible that removing those might fix your trouble, if so my guess is that having the text set to another id was confusing something into thinking that your list didn’t have the id list

    If that does not solve your problem I would suggest switching to a plain Activity instead of ListActivity and getting the reference to your ListView via findViewById() like they do in the example that you linked.

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

Sidebar

Related Questions

If i had a list of balls each of which has a color property.
I have two data tables which have a primary key column in common but
I have two columns, the first column will have the name of a object,
I'm trying to join two SQL tables, parent (which I have complete design control
I have a guest list that has a last name in one column and
I've spent hours on this one with no luck. I'm trying to delete list
I heard this today during interview for java developer. I had to list some
I Had Drop down list and I want to fill it with data from
Let's say I had: protected void performLogic(List<Object> docs) { ... } In the code
So basically the assignment was we had to create a doubly linked list that's

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.