0

这是我的代码:

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

创建了警报框但没有行空间,您使用什么来创建行空间?

4

1 回答 1

0

下一行使用 \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();
于 2013-10-05T20:43:51.970 回答