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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:20:02+00:00 2026-05-22T18:20:02+00:00

I am having a force close problem with my application using ListView. The problem

  • 0

I am having a force close problem with my application using ListView. The problem only occurs when I use ListActivity in stead of Activity. The wierd part is that I have another class which does exactly the same thing, but just with another table from the database and it is working fine. I tried to remove everything in my class and just display the view, but I still get the force close.

I found some simular questions on the site, but the answers did not work for me.

Anybody have any clue of what I am doing wrong? – Any help much appreciated.

My xml file:

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">
<ListView android:id="@+id/android:list" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" /> 
<TextView android:id="@+id/android:empty" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="No recipes!" /> 
</TableLayout>

My Class:

public class RecipesAlphabet extends ListActivity {

private GroceryDbAdapter mDbHelper;


public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.alphabetical);

    mDbHelper = new GroceryDbAdapter(this);
    mDbHelper.open();
    fillRecipes();
    mDbHelper.close();
    registerForContextMenu(getListView());
    } 
private void fillRecipes() {
    Cursor recipeCursor = mDbHelper.fetchAllRecipes();
    startManagingCursor(recipeCursor);

    String[] from = new String[] {GroceryDbAdapter.KEY_RECIPE};
    int[] to = new int[] {R.id.text1};

    SimpleCursorAdapter recipes = new SimpleCursorAdapter(this, R.layout.groceries_row, recipeCursor, from, to);
    setListAdapter(recipes);

}
}

Log Cat:

05-26 19:00:23.864: DEBUG/AndroidRuntime(401): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
05-26 19:00:23.864: DEBUG/AndroidRuntime(401): CheckJNI is ON
05-26 19:00:24.134: DEBUG/AndroidRuntime(401): --- registering native functions ---
05-26 19:00:25.454: DEBUG/AndroidRuntime(401): Shutting down VM
05-26 19:00:25.464: DEBUG/dalvikvm(401): Debugger has detached; object registry had 1 entries
05-26 19:00:25.475: INFO/AndroidRuntime(401): NOTE: attach of thread 'Binder Thread #3' failed
05-26 19:00:26.154: DEBUG/AndroidRuntime(415): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
05-26 19:00:26.154: DEBUG/AndroidRuntime(415): CheckJNI is ON
05-26 19:00:26.394: DEBUG/AndroidRuntime(415): --- registering native functions ---
05-26 19:00:27.294: INFO/ActivityManager(58): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.aqeel.grocerylisttest/.Main }
05-26 19:00:27.524: DEBUG/AndroidRuntime(415): Shutting down VM
05-26 19:00:27.564: DEBUG/dalvikvm(415): Debugger has detached; object registry had 1 entries
05-26 19:00:27.634: INFO/AndroidRuntime(415): NOTE: attach of thread 'Binder Thread #3' failed
05-26 19:00:27.694: INFO/ActivityManager(58): Start proc com.android.aqeel.grocerylisttest for activity com.android.aqeel.grocerylisttest/.Main: pid=422 uid=10042 gids={}
05-26 19:00:29.274: INFO/ActivityManager(58): Displayed activity com.android.aqeel.grocerylisttest/.Main: 1755 ms (total 257143 ms)
05-26 19:00:34.543: DEBUG/dalvikvm(124): GC_EXPLICIT freed 252 objects / 11688 bytes in 209ms
05-26 19:00:40.393: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.android.aqeel.grocerylisttest/.Recipes }
05-26 19:00:40.454: DEBUG/dalvikvm(58): GREF has increased to 301
05-26 19:00:41.043: INFO/ActivityManager(58): Displayed activity com.android.aqeel.grocerylisttest/.Recipes: 598 ms (total 598 ms)
05-26 19:00:42.453: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.android.aqeel.grocerylisttest/.RecipesAlphabet }
05-26 19:00:42.563: DEBUG/AndroidRuntime(422): Shutting down VM
05-26 19:00:42.563: WARN/dalvikvm(422): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
05-26 19:00:42.603: ERROR/AndroidRuntime(422): FATAL EXCEPTION: main
05-26 19:00:42.603: ERROR/AndroidRuntime(422): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.aqeel.grocerylisttest/com.android.aqeel.grocerylisttest.RecipesAlphabet}: java.lang.IllegalArgumentException: column '_id' does not exist
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.os.Handler.dispatchMessage(Handler.java:99)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.os.Looper.loop(Looper.java:123)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.app.ActivityThread.main(ActivityThread.java:4627)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at java.lang.reflect.Method.invokeNative(Native Method)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at java.lang.reflect.Method.invoke(Method.java:521)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at dalvik.system.NativeStart.main(Native Method)
05-26 19:00:42.603: ERROR/AndroidRuntime(422): Caused by: java.lang.IllegalArgumentException: column '_id' does not exist
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:314)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.widget.CursorAdapter.init(CursorAdapter.java:111)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.widget.CursorAdapter.<init>(CursorAdapter.java:90)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.widget.ResourceCursorAdapter.<init>(ResourceCursorAdapter.java:47)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.widget.SimpleCursorAdapter.<init>(SimpleCursorAdapter.java:84)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at com.android.aqeel.grocerylisttest.RecipesAlphabet.fillRecipes(RecipesAlphabet.java:32)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at com.android.aqeel.grocerylisttest.RecipesAlphabet.onCreate(RecipesAlphabet.java:21)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-26 19:00:42.603: ERROR/AndroidRuntime(422):     ... 11 more
05-26 19:00:42.714: DEBUG/dalvikvm(422): GC_FOR_MALLOC freed 5728 objects / 343136 bytes in 110ms
05-26 19:00:42.733: WARN/ActivityManager(58):   Force finishing activity com.android.aqeel.grocerylisttest/.RecipesAlphabet
05-26 19:00:42.753: WARN/ActivityManager(58):   Force finishing activity com.android.aqeel.grocerylisttest/.Recipes
05-26 19:00:43.253: WARN/ActivityManager(58): Activity pause timeout for HistoryRecord{450e6a18 com.android.aqeel.grocerylisttest/.RecipesAlphabet}
05-26 19:00:44.774: INFO/Process(422): Sending signal. PID: 422 SIG: 9
05-26 19:00:44.827: INFO/WindowManager(58): WIN DEATH: Window{450df0f8 com.android.aqeel.grocerylisttest/com.android.aqeel.grocerylisttest.Main paused=false}
05-26 19:00:44.827: INFO/ActivityManager(58): Process com.android.aqeel.grocerylisttest (pid 422) has died.
05-26 19:00:44.844: INFO/WindowManager(58): WIN DEATH: Window{450e3c80 com.android.aqeel.grocerylisttest/com.android.aqeel.grocerylisttest.Recipes paused=true}
05-26 19:00:44.895: INFO/UsageStats(58): Unexpected resume of com.android.launcher while already resumed in com.android.aqeel.grocerylisttest
05-26 19:00:45.753: WARN/InputManagerService(58): Got RemoteException sending setActive(false) notification to pid 422 uid 10042
  • 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-22T18:20:03+00:00Added an answer on May 22, 2026 at 6:20 pm

    Check the creation of your tables, since your cursor is looking for a column that is not present in the new table:

    Caused by: java.lang.IllegalArgumentException: column '_id' does not exist
    

    You need to rename your Primary Key column “_id“

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

Sidebar

Related Questions

I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback,
Is there any way to force an update of software using RunOnce, without having
I'm having a bit of a problem with my Android application. I have 2
I'm trying to build a Python application using pyGTK, treads, and sockets. I'm having
I'm having a problem with some reports in the application I'm doing manutention I've
I'm forced to upgrade to Python 2.6 and am having issues using Numerical Python
Having a problem getting a TreeView control to display node images. The code below
I'm having some problems with my WCF server and client connections. If I use
I'm having issues with the following code, where I use a JComboBox to change
I'm having a problem trying to add an object to an object context in

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.