To set the text in italics, you can do the following:
EditText.setText(Html.fromHtml("<small><i>" + "Text Hint Here" + "</i></small>"));
If you want italic text to be a hint - when EditText is empty, for example, you should implement a method for checking the length of the text, and when it is zero, apply the above code.
source
share