Hello! There is a SQLite database. Input field edit text. How in a situation when nothing was entered into edittext to save the value 0 ??? (I enter double). Since if nothing is entered, you get an error.
- fourApparently, it is obvious to check before saving that the field is empty and force it to assign 0. In this case, it is not possible to say more to your question because you did not give the code how exactly you save to the database and did not say which error occurs - Mike
- Add in the layout in EditText line android: hint = "Enter your text" - Tommy
|
1 answer
You will get an error when reading from the database, while writing will be NULL, if you do not specify a value.
Two options:
- The answer to the question is normal (I do not understand the minus to the answer), leave a comment if you have something to say. - Alexander Puzanov
- Good day. I do not know why you put a minus, but since you suggested it suits me. - Bombey77
- If appropriate, choose as the answer. Thank. - Alexander Puzanov
|
