Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
連絡先を登録しています(単にテストするためです)が、editTextが空白の場合でもデータベースに値を送信します。削除して、そのためのif / elseステートメントを作成するにはどうすればよいですか?私は試した
if(myVariable == null){ code... }....
しかし、それは機能していません。「null」は空白の場合を意味しますが、私はそれが初めてなのであまり知りません。
その値をデータベースに送信するときに EditText が空でないことを確認しようとしていますか?
EditText text = ... if(text.getText.toString().length() != 0){ ...database code }