I have an sqlite database that the user can register to! I have successfully created a login form and when the login is successful (username & password matchthe database's) the user is redirected to another activity. What i want is in the activity that the user is redirected, to diplay his entire database row (id,username, books,email,course, password, student name)!!in a list view or any other possible format Any ideas?? This the database creation code
static final String DATABASE_CREATE = "create table "+"LOGIN"+
"( " +"ID"+" integer primary key autoincrement,"+ "USERNAME varchar2," +
"PASSWORD varchar2, COURSE varchar2, EMAIL varchar2, STUDENT_NAME varchar2); ";
and this is the code that stores data in the database:
public void insertEntry(String userName,String password,String course,String email, String student_name)
{
ContentValues newValues = new ContentValues();
// Assign values for each row.
newValues.put("USERNAME", userName);
newValues.put("PASSWORD",password);
newValues.put("COURSE", course);
newValues.put("EMAIL",email);
newValues.put("STUDENT_NAME", student_name);
// Insert the row into your table
db.insert("LOGIN", null, newValues);
///Toast.makeText(context, "Reminder Is Successfully Saved", Toast.LENGTH_LONG).show();
}
Finally this ths login code
if(password.equals(storedPassword))
{
Toast.makeText(MyActivity.this, "Congrats: Login Successfull", Toast.LENGTH_LONG).show();
dialog.dismiss();
startActivity(new Intent(MyActivity.this, Login_home.class));
}
else
{
Toast.makeText(MyActivity.this, "User Name or Password does not match", Toast.LENGTH_LONG).show();
}
I would really appreciate if you could help me!!!
Aucun commentaire:
Enregistrer un commentaire