- Button addbtn = (Button) findViewById(R.id.fishaddbutton);
- addbtn.setOnC;lickListener(new View.OnC;lickListener()
- {
- public void onC;lick(View v)
- {
- EditText idEditText = (EditText) findViewById(R.id.ideditText);
- EditText nameEditText = (EditText) findViewById(R.id.nameeditText);
- EditText typeEditText = (EditText) findViewById(R.id.typeeditText);
- EditText ageEditText = (EditText) findViewById(R.id.ageeditText);
- id = idEditText.getText().toString();
- name = nameEditText.getText().toString();
- type = typeEditText.getText().toString();
- age = ageEditText.getText().toString();
- db.execSQL("INSERT INTO " + tableName + "(name, type, age) VALUES (" +
- "'"+ name +"',"+
- "'"+ type +"',"+
- "'"+ age +"')");
- Toast.makeText(getApplicationContext(), "등록되었습니다", Toast.LENGTH_SHORT).show();
- Intent intent = new Intent(getApplicationContext(), IntroActivity.class);
- startActivity(intent);
- }
- });
- }
여기 소스에서
- db.execSQL("INSERT INTO " + tableName + "(name, type, age) VALUES (" +
- "'"+ name +"',"+
- "'"+ type +"',"+
- "'"+ age +"')");
얘 하나 때문에 계속 강제 종료 당함 ...
DB생성이랑 테이블 생성은 된거 같은데 ...
데이터 삽입을 하고 싶은데 삽입이 안되네 ㅜ
조공
에러 로그는 안뜨디;;?
먹튀
그.. 같은데... 에 발등 찍힐 수 있음. adb shell 로 가서 select * 해 보기 바람.