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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:10:07+00:00 2026-05-31T09:10:07+00:00

In a previous question I posted (which contains all the code) Unable to substantiate

  • 0

In a previous question I posted (which contains all the code)

Unable to substantiate activity ComponentInfo – Null Pointer Exception

I had a nullexception error, howver having beaten that runtime error, i have tripped over another. the log cat is:

03-14 17:43:25.169: ERROR/AndroidRuntime(339): FATAL EXCEPTION: main
03-14 17:43:25.169: ERROR/AndroidRuntime(339): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.dbtest/com.android.dbtest.ShowActivity}: java.lang.IllegalArgumentException: column '_id' does not exist
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1622)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.os.Looper.loop(Looper.java:123)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.app.ActivityThread.main(ActivityThread.java:3647)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at java.lang.reflect.Method.invokeNative(Native Method)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at java.lang.reflect.Method.invoke(Method.java:507)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at dalvik.system.NativeStart.main(Native Method)
03-14 17:43:25.169: ERROR/AndroidRuntime(339): Caused by: java.lang.IllegalArgumentException: column '_id' does not exist
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:314)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.widget.CursorAdapter.init(CursorAdapter.java:111)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.widget.CursorAdapter.<init>(CursorAdapter.java:90)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.widget.ResourceCursorAdapter.<init>(ResourceCursorAdapter.java:47)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.widget.SimpleCursorAdapter.<init>(SimpleCursorAdapter.java:84)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at com.android.dbtest.ShowActivity.onCreate(ShowActivity.java:45)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
03-14 17:43:25.169: ERROR/AndroidRuntime(339):     ... 11 more

this problem occurs once the Show button has been pressed and the ShowActivity is launched (the answer to the above link regarding where to init the listcontent has been implemented) – however, it now seems to be failing due to the colum _id. Which as far as i can see is initilised in my adapter.

Any help , greatfully received.

EDIT: Added the following code – and addign comment below

package com.android.dbtest;

import android.database.Cursor;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.SimpleCursorAdapter;

public class AddActivity extends DatabaseTestActivity{

private SQLiteAdapter mySQLiteAdapter;
private String jobId;

SimpleCursorAdapter cursorAdapter;
Cursor cursor;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.add);
    // TODO Auto-generated method stub

    final EditText jobIdInput = (EditText) findViewById(R.id.jobText); 
    //final EditText address1Input = (EditText) findViewById(R.id.add1Text);  to be implemented

    /**************************************************
     * 
     *  Get text Input from Edit Text Fields
     * 
     ***************************************************/

    jobIdInput.addTextChangedListener(new TextWatcher(){

        @Override
        public void afterTextChanged(Editable id) {
            jobId = jobIdInput.getText().toString();

        }

        @Override
        public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
                int arg3) {
            // TODO Auto-generated method stub

        }

        @Override
        public void onTextChanged(CharSequence arg0, int arg1, int arg2,
                int arg3) {
            // TODO Auto-generated method stub

        }

    });

    /***************************************************
     * 
     *  initialise Database
     * 
     * 
     ***************************************************/
    mySQLiteAdapter = new SQLiteAdapter(this);

    /*****************************************************
     * Listen for Confirm button press
     ******************************************************/

    final Button confirm = (Button)findViewById(R.id.confirmButt);

    confirm.setOnClickListener(new OnClickListener(){

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            mySQLiteAdapter.openToWrite();
            mySQLiteAdapter.insert(jobId);
            mySQLiteAdapter.close();
        }

    });

    /***********************************************************
     * write jobId into SQl in the above method for button press
     * 
     *************************************************************/     
}
}
  • 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-31T09:10:08+00:00Added an answer on May 31, 2026 at 9:10 am

    Managed to work out the answer; from the fact that the database was not actually being created. Was not effected by version changes, moreover what the solution was was to initalise the database in the Main DatabaseTestActivity NOT the AddActivty!!

    Of course no i have smacked right into another NullPointerException – but at least it is a different problem to deal with now!!

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

Sidebar

Related Questions

This is a continuation of my previous question which I posted when I wasn't
This question is following a previous one which i posted: Django Callback on Facebook
I have the following code (from a previous question on this site) which retrieves
In this previous question I posted most of my own shell code. My next
An answer posted for one of my previous questions brings up another question; I
In previous question of mine, someone had meantioned that using Semaphores were expensive in
This question is related to a previous question of mine That's my current code
This question was inspired by a previous question posted on SO, Does the order
In a previous question i made Dynamic dependent select menus i posted this example
This question is based off of the same app/source from my previous question which

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.