I have two edittext input box. First one is for username and the second one is for password. I want put hint on the inputbox. I have wrote hint with settex() method. In addition, I have wrote
in onclick(view v)
text1 = findViewById(R.id.editText_1);
setHint() provides the hint that disappears when the user types something. You can also use a String resource ID or an xml based approach, but in your case, using the String method will suffice.
setText() when you want to put text in the EditText that the user can modify.