I am developing an Android app which takes some data from text fields entered by the user, and outputs a single string in a new text field based on this data. Simple enough, however I need parts of the string to be in italics.
I have found out how to make the entire text field display in italics (shown below) but how about choosing only specific variables which make up the string to be shown in italics?
public class RefGenActivity extends Activity {
private EditText reftext;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_refgen);
reftext = (EditText) findViewById(R.id.editText1);
reftext.setTypeface(null, Typeface.ITALIC); //SET TO ITALICS
reftext.setText(getRef());
}
Any help would be much appreciated!