Search code examples
javaandroidandroid-edittexttextviewsettext

settext for more than one edittext in vertical lines


I'm beginner in android development and i'm trying to build an app with multiple equations and i need the result to be viewed in one text and in vertical lines every result for equation viewed in line, i know how to show them together but it will show them either for the same line or in un-arranged manner like this code:

Result.setText("MDRD=" + Double.toString(m) + " MDRD.abbv" + Double.toString(b));

,, So what i have to do to show them like this????

MDRD= 9999 // any number

MDRD.abbv =8888 // any number

,, in another way :

if i have an equation and i want show the result in text, i'll use "Result.setText", also if i want to show more than one equation's result in the same text "Result", i can use "+", but what i want to show more than one equation's result in the same text "Result" but every equation's result appear in one line


Solution

  • If I understood your question right you are trying to add a line break to textview (Result)?! This can be easily achieved by adding a newline \n to your String:

    Result.setText("MDRD=" + Double.toString(m) + "\nMDRD.abbv" + Double.toString(b));