I am trying to create an Android app where data is read and alignment differs if a certain string is contained in the data. The data is then appended onto a textview with a carriage return. Using append, is there any way for me to change the text alignment for individual line entries? Currently what I've been doing is this
if(returnedData.contains(myVar)) {
myTextView.setGravity(Gravity.END);
} else {
myTextView.setGravity(Gravity.START);
}
Obviously this does not work because it changes the alignment of every line with each new append. Thank you ahead of time for any help.