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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:43:08+00:00 2026-06-05T10:43:08+00:00

I create this table: create table + DATABASE_TABLE + ( + KEY_ROWID + integer

  • 0

I create this table:

"create table "  + DATABASE_TABLE + " ("
    + KEY_ROWID + " integer primary key autoincrement not null, "
    + KEY_TITLE + " text not null, "
    + KEY_BODY + " text not null, " + KEY_DATE_TIME + " text not null);"

and here is what I do for inserting:

ContentValues initialValues = new ContentValues();
initialValues.put("title", title);
initialValues.put("body", body);
initialValues.put("abc", anc);
return mDb.insert(DATABASE_TABLE, null, initialValues); 

but due to some error my app force closes. Help me out please…

Logcat errors:

java.lang.NullPointerException
com.maddy.task_reminder.ReminderDbAdapter.createReminder(ReminderDbAdapter.java:133)
06-09 23:28:44.112: E/AndroidRuntime(412):  at com.maddy.task_reminder.edit_activity$4.onClick(edit_activity.java:143)
  • 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-05T10:43:11+00:00Added an answer on June 5, 2026 at 10:43 am

    If you are following the generic DBAdapter examples on the web, check that you call:

    mDbHelper.open();
    

    in your Activity. Otherwise mDb is never instantiated in your database helper class, it is always null.

    Addition from Comment:

    So this is your open() method.

    public ReminderDbAdapter open() throws SQLException { 
        mDbHelper = new DatabaseHelper(mCtx); 
        mDb = mDbHelper.getWritableDatabase(); 
        return this; 
    }
    

    If your ReminderDbAdapter constructor doesn’t look like this:

    public ReminderDbAdapter(Context context) {
        ...
        mCtx = context;
        open(); // Do you have this line?
    }
    

    Then you need to explicitly call ReminderDbAdapter.open() in your activity, possibly like this:

    ReminderDbAdapter mDbHelper = new ReminderDbAdapter(this); 
    mDbHelper.open();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This does not execute: create table TestTable (name text, age integer, primary key (ROWID))
My table definition is: CREATE TABLE Product (ProID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
I have this table CREATE TABLE [dbo].[friend_blocked_list]( [subdomain] [varchar](50) NOT NULL, [un] [nvarchar](50) NOT
I have this table CREATE TABLE `codes` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
I have a table Messages with columns ID (primary key, autoincrement) and Content (text).
With this code: var db = google.gears.factory.create('beta.database'); db.open('cominar'); db.execute('CREATE TABLE IF NOT EXISTS Ajax
Structure: CREATE TABLE `links` ( `id` int(11) NOT NULL auto_increment, `title` int(11) default NULL,
I have Mysql datatbase, and working on servlet: this is my Table schema: CREATE
I want to create this table in Oracle. This is only the table SQL
I want to create this JSF table with paging and sorting. This is JSF

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.