2013-10-05 4 views
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(); 
    } 

ЯЩИК оповещения создается, но нет линии пространства, то, что можно использовать для создания строки пробелы?

+0

не Вы должны просто использовать «текст в Линекс \ п», где «\ п» заменяется на символ новой строки? eq. "3. Активирует контролируемый вызов \ n". – Axxxon

ответ

0

Используйте \ п для следующей строки

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(); 
Смежные вопросы