안드로이드 개발 질문/답변
(글 수 45,052)
EditText editText3 = (EditText)this.findViewById(R.id.editText3);
EditText editText4 = (EditText)this.findViewById(R.id.editText4);
EditText editText5 = (EditText)this.findViewById(R.id.editText5);
String selectIdStr = editText3.getText().toString();
int selectId = Integer.parseInt(selectIdStr);
Cursor cursor = dbhandler.select(selectId);
String name = cursor.getString(cursor.getColumnIndex("num_name"));
String name1 = cursor.getString(cursor.getColumnIndex("body_name"));
if((editText4.getText().toString()).equals(name) && (editText5.getText().toString()).equals(name1)){
Intent intent1 = new Intent(this,ExamNetworkActivity.class);
startActivity(intent1);
}
소스는 이렇습니다.
데이터 베이스는
_id num_name body_name
1 01543 22
2 01842 36
3 11042 456
이런식으로 되어있다고 할 때
editText3 에는 _id
editText4 에는 num_name
editText5 에는 body_name
이렇게 넣고 값이 맞으면 다음페이지로 넘어가는 로그인 페이지를 만들고 있습니다.
여기서
저는 editText3을 빼고 싶습니다. 로그인 할때 num_name 을 아이디로 body_name을 비밀번호로 쓰고 싶거든요.
그런데 자꾸 오류가 나고 결국엔 처음으로 돌아왔습니다.
도와주세요~~