Я хочу вернуть имя пользователя и пароль, но он возвращает только имя пользователя. Это мой java
код. Пожалуйста, проверьте это и помогите мне найти ошибку.
String query = "Select * FROM " + Table_name_student
+ " WHERE " + col1 + " = \""
+ usrname +"\""+"and "+col4+" = \""+password;
SQLiteDatabase db = this.getWritableDatabase();
Cursor cursor = db.rawQuery(query, null);
if(cursor.getCount() <= 0) {
cursor.close();
db.close();
return false;
}
else
{
cursor.close();
db.close();
return true;
}
и мой xml
равен
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".aboutus">
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginStart="17dp"
android:layout_marginLeft="17dp"
android:layout_marginTop="110dp"
android:text="Work colleagues and friends noted that
Lincoln had a capacity to defuse tense and argumentative situations,
though the use of humour and his capacity to take an optimistic view of human nature.
He loved to tell stories to illustrate a serious point through the use of humour and parables" />
</RelativeLayout>