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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:39:19+00:00 2026-05-28T02:39:19+00:00

I am Working on simple login application in which user is first shown login

  • 0

I am Working on simple login application in which user is first shown login screen, in login screen I have two edittext to let the user enter usrname and password. If user presses the register button then the application takes the user to registration page where the registration details in four fields named(uname,pwd, Email Add,Postal Add) entered by user should be inserted in database.

In my Registration class I have created object of my DatabaseOperation Class by passing the context of Registration class, then the constructor of DatabaseOperation is called as the constructor is called context object is copied in another object named mcontext. After this method named Create_tbl to create the table is callled.

In this method I called OpenOrCreateDatabase() Method with mcontext object as…….

public void Create_Tbl()
    {
    db = mcontext.openOrCreateDatabase("Register.db", SQLiteDatabase.CREATE_IF_NECESSARY,null);
    CREATE_TABLE_REGISTER = "CREATE TABLE IF NOT EXISTS "+table_name+"(u_id INTEGER PRIMARY KEY AUTOINCREMENT,u_name TEXT,u_eadd TEXT,u_pwd TEXT,u_padd TEXT)";
    db.execSQL(CREATE_TABLE_REGISTER);
    }

My Question is : Why I am getting NullPointerException at openOrCreateDatabase().

In addition I am getting NullPointerException at two other places

  1. Create_Tbl();
  2. DatabaseOperation dos = new DatabaseOperation(Registration.this);
  • 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-28T02:39:20+00:00Added an answer on May 28, 2026 at 2:39 am

    There may be many issues, with this problem, but most striking is mContext, please debug your code and check it is not null. and call method openOrCreateDatabase (String path, SQLiteDatabase.CursorFactory factory) instead of openOrCreateDatabase (String path, SQLiteDatabase.CursorFactory factory, null).

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

Sidebar

Related Questions

I'm now working on Sample login application in which user can login with their
I'm working on a simple javascript login for a site, and have come up
i am working on a simple web app which has a user model and
I am working on a simple CAD program which uses OpenGL to handle on-screen
I've implemented a simple WPF splash screen window which informs the user about the
I am working on a navigation based application which involves LOGIN view. My approach
I'm working on a simple multiplayer game in which 2-4 players are placed at
I am working on a simple chat application using a System.Windows.Forms.WebBrowser Control to display
I have a simple ASP.NET MVC 3 application. I have the database I designed
I have a simple set of urls in a Django url conf file 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.