mardi 10 février 2015

How to display error message in activity when unique constraint occurs in SQlite database in android

I am creating an application that consists of a registration form using sqlite database. In this registration form i want to make the username as a unique constraint. But in this i want to display an error toast message in activity when unique usernames was occurred in database.Please let me know how to do it please this is my android DB adapter activity



static final String DATABASE_CREATE = "create table "+"LOGIN"+
"( " +"ID"+" integer primary key autoincrement,"+"USERNAME text UNIQUE,PASSWORD text); ";

Aucun commentaire:

Enregistrer un commentaire