I am exctracting data from sqlite database and i need to transfer a column exctracted from select statment to other activity on a textview. How do i do it. Here’s my code.
db=database.getReadableDatabase();
Cursor c = db.rawQuery("SELECT lusername, lpwd, lname FROM login WHERE
lusername=userfield.getText().toString(),lpwd=pwdfield.getText().toString()",null);
if(c!=null)
{
Intent intent = new Intent(this, HomePage.class);
intent.putExtra("TITLEBAR", lname);
}
i want lname(column) to go to next activity’s textview.
First of all I doubt on your select query whether its worked or not..
But you told “I am extracting data from sqlite database” fine,
then just make a
String[] of lnamecolumn’s values from your database cursor then pass thatString[]to other activity usingintentlike,..Create intent:
Then in your intent_name.class do: