Following is the code to display EditText,
<EditText
android:id="@+id/editStartingPoint"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:gravity="left|center_vertical"
android:hint="@string/StartingPointHint"
android:inputType="text"
android:maxLength="8"
android:padding="10dp"
android:text=""
android:textColor="@color/login_lbl"
android:textSize="@dimen/settings_list_font_size" />
In Activity file, onCreate() method,
edtStartPoint = (EditText) findViewById(R.id.editStartingPoint);
edtStartPoint.setText ( Html.fromHtml( "<small><i>" + "This should be in Italic" + "</i></small>" ));
I also tried,
edtStartPoint.setTypeface( null, Typeface.ITALIC );
I have also tried to set textStyle="italic"
in my .xml file
but the problem is that Text is not displaying in Italic style, What could be the problem ? Please help me out.
Edit : It is also not showing Text in bold format. xml preview it is showing fine, but when I run the code in real device Samsung S7562, it is displaying a normal text only