Reputation: 96
hello :) im trying to make my game type:
Current score: X
In : Y seconds (between them, skip a line.) Here is the code I tried to use:
changingTextView.setText("current score:"+counter+ \n- +"in"+TimeCounter+"seconds");
The \n or /n is not working to me.. I also tried :
changingTextView.setText("current score:"+counter+ <br> +"in"+TimeCounter+"seconds");
It is not working too..
Upvotes: 1
Views: 89
Reputation: 14408
Try <br>
as
changingTextView.setText(Html.fromHtml("current score:"+counter+ "<br>" +"in"+TimeCounter+"seconds"));
And make sure your \n is in "\n" for it to work.
changingTextView.setText("current score:"+counter+ "\n" + "-" +"in"+TimeCounter+"seconds");
Upvotes: 0
Reputation: 21551
Try this:
changingTextView.setText("current score:"+counter+ System.getProperty("line.separator") +"in"+TimeCounter+"seconds");
Upvotes: 2