Java 需要在警报框对话框中创建行空格
这是我的密码:Java 需要在警报框对话框中创建行空格,java,android,Java,Android,这是我的密码: public void create_dialoginfo() { AlertDialog.Builder alert = new AlertDialog.Builder(main.this); alert.setTitle("911 Info"); alert.setMessage( "Button Description: " + "" +
public void create_dialoginfo()
{
AlertDialog.Builder alert = new AlertDialog.Builder(main.this);
alert.setTitle("911 Info");
alert.setMessage(
"Button Description: " +
"" +
"1. Calls 911 " +
"2. Sends GPS Cordinates to Contact " +
"3. Activates a monitored call " +
"4. Activates alarm and captures images to web for viewing");
alert.setPositiveButton("Ok", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
// TODO Auto-generated method stub
}
});
alert.create();
alert.show();
}
警报框已创建,但没有行间距,您使用什么来创建行间距?使用\n作为下一行
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle("911 Info");
alert.setMessage("Button Description: \n1. Calls 911\n2. Sends GPS Cordinates to Contact\n3. Activates a monitored call\n4. Activates alarm and captures images to web for viewing");
alert.setPositiveButton("Ok",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
alert.create();
alert.show();
您不应该只使用“linex中的文本”\n“其中“\n”更改为新行字符吗?等式“3.激活受监控的呼叫\n”。