Форматирование текста в окне предупреждения - PullRequest
0 голосов
/ 21 февраля 2012

ребята, у меня есть такой текст:

A: hi how are you.
B: I am fine thank you.
A: how is your mother.
B: she is fine.

Я хочу, чтобы точно так же отображался в окне предупреждения независимо от длины текста. Ниже приведен мой код окна предупреждения.

AlertDialog.Builder bu = new AlertDialog.Builder(this);
bu.setMessage(""+((Node) textFNListU.item(0)).getNodeValue().trim());
bu.setCancelable(true);
bu.setPositiveButton("OK",new DialogInterface.OnClickListener() {
            @Override
                public void onClick(DialogInterface dialog, int id) {
                // TODO Auto-generated method stub
                                dialog.cancel();
                            }
                        });
                bu.create().show();



+((Node) textFNListU.item(0)).getNodeValue().trim() ->this value i am fecthing from xml.

как добиться этого

1 Ответ

1 голос
/ 21 февраля 2012

попробуйте это:

bu.setMessage(""+((Node) textFNListU.item(0)).getNodeValue().trim().replace(".",".\n"));
...