how to toast a message if editText is empty by clicking button?

前端 未结 5 986
暗喜
暗喜 2021-01-24 09:19

i have 2 edit Text in my application, 1 button to add the input numbers in the edit Text and 1 text view to display the result. I would like to put a toast message if my edit te

5条回答
  •  盖世英雄少女心
    2021-01-24 09:44

    Add to your click listener check

    Toast toast = Toast.makeText(MainActivity.this, "Your Message", Toast.LENGTH_SHORT);
    toast.show();
    

提交回复
热议问题