How can I add newline("\n") on Dialog.alert(textfromxml)?

1.7k Views Asked by At

this '\n' doesnt work. Also I tried with LabelField and TextField. Result is same.:( my code:))

 Dialog.alert(errorString);

and my xml line.

1) Check your camera's ip address and port number.'\n'2) Try Again

3

There are 3 best solutions below

0
On BEST ANSWER

I found a solution.

I use 
 for \n. It works good.

3
On

This should work:

String errorString = 
    "1) Check your camera's ip address and port number.\n2) Try Again";

Dialog.alert(errorString);
0
On

If it doesn't work, you can implement your own Dialog class. Just do like this:

Dialog d = new Dialog(Dialog.D_OK,"your message here",Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Screen.DEFAULT_CLOSE);

//you can add customized fields here, like a LabelField

d.show();