Skip to content Skip to sidebar Skip to footer

App Stopped Working Due To Database

I am creating a signup page, when I enter different passwords, toast is working just fine. But when I enter same passwords. MainActivity is not being redirected to a yaya Activity

Solution 1:

android.database.sqlite.SQLiteException: near "mull": syntax error (code 1): , while compiling: createtable contacts (id integer primary key not mull auto_increment

The correct declaration for an autoincrement PK column is integer primary key autoincrement, not integer primary key not mull auto_increment. You have a typo in null and the not null is not required. There is no underscore in sqlite autoincrement.

Solution 2:

Create a Global variable of Helper class.

DatabaseHelper helper;

Then add this code into onCreate

helper = new DatabaseHelper(SignUp.this);

Solution 3:

Move DatabaseHelper helper = new DatabaseHelper(this); to onCreate after setContentView(R.layout.signup);

EDIT

As per your logcat, it seems there is a typo in your CREATE statement. You have misspelt null as mull. Also write AUTOINCREMENT instead of auto_increment.

Post a Comment for "App Stopped Working Due To Database"