开发者

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

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 ca开发者_JS百科mera's ip address and port number.'\n'2) Try Again


I found a solution.

I use 
 for \n. It works good.


This should work:

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

Dialog.alert(errorString);


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();

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜