Reputation: 1
Using the following code I am unable to break the line to 2.
builder.setMessage(Html.fromHtml("<b>"+"World"+"</b>+\n+second line"))
Result I get like:
World+ +second line
Upvotes: 0
Views: 3245
Reputation: 3243
If you are using Html.fromHtml()
then use <br/>
where you want a line break
for e.g:
builder.setMessage(Html.fromHtml("<b>"+"World"+"</b><br/>"+"second line"))
and if not Html
and just String you can use \n
where you want a line break
.
Upvotes: 2
Reputation: 5451
You can easily do it by writing below code :
builder.setMessage("First line \n"+"second line"));
Upvotes: 0
Reputation: 26
en..u can use '\n',like that
ProgressDialog progressDialog=new ProgressDialog(MainActivity.this);
progressDialog.setMessage("Str1"+"\n"+"Str2"+"\n"+"Str3");
progressDialog.show();
you can try it.
Upvotes: 0