button_insert.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
input_name = (EditText) findViewById(R.id.input_Name);
input_phoneno = (EditText) findViewById(R.id.input_PhoneNo);
ContentValues values = new ContentValues();
values.put("Name", input_name.getText().toString());
values.put("PhoneNo", input_phoneno.getText().toString());
myDB.insert("members", null, values);
}
});
I wrote it like this in the onCreate() method, but the program ends when I click the button ㅠ<
Could you tell me how to solve it?
Even if you don't write it in code, I think it will be very helpful if you answer it in writing!
android edittext database listview
I'm not sure how the db interface is implemented, but I don't think it's common to inflate it with findViewById when you click on it
I don't know if there's an error in inflating the edit text with View onClick. I'm just guessing because I didn't see the error log;;
It could be related to Thread management. Check if there is any impact when calling insert from DB.
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
581 PHP ssh2_scp_send fails to send files as intended
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.