伙计们我有这样的文字:
A: hi how are you.
B: I am fine thank you.
A: how is your mother.
B: she is fine.
我希望以同样的方式在警报窗口中显示文字lenght.below是我的警报窗口代码。
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.
如何实现这个
答案 0 :(得分:1)
试试这个:
bu.setMessage(""+((Node) textFNListU.item(0)).getNodeValue().trim().replace(".",".\n"));