Android SMS to more than one destinationAdress throws NullPointerException
<p>Hy, my major problem is to send a sms to selected destinationAdresses. Mostly more than one. The selection is working fine but the methode to send the sms always shows NullPointerException and I'm not able to locate the main error.
The emerNames is a simple Array of Strings, the emerNumbers as well!
The text to send in my mind isn't the problem but maybe the sending operation with the array in the for-loop!</p>

<p>Any suggestions?</p>

<pre><code>        AlertDialog.Builder settingMessage = new AlertDialog.Builder(c);

    settingMessage.setTitle("SOS- Empfänger wählen");
    settingMessage.setMultiChoiceItems(emerNames, checkItem, new DialogInterface.OnMultiChoiceClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which, boolean isChecked) 
        {

            if (isChecked == true)
            {

                Log.i("AlertChoice", "SelectedItem: "+emerNames[which]);
                ischecked[which] = true;
                //emerNumbers[which]=emerNames[which];

            }

            else
            {
                ischecked[which]=false;
                //emerNumbers[which]= "";
                Log.i("AlertChoice", "Deseclected Item "+emerNames[which]);
            }

        }
    } );

    settingMessage.setNeutralButton("SOS senden", new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) 
        {

            for (int i = 0; i&lt;ischecked.length;i++)
            {
                if (ischecked[i]== true)
                {
                    Log.i("Selection", "SelectedItems:"+ emerNumbers[i]);
                    String text;
                    text = "HILFE, ich befinde mich in einer Notlage\n"
                            +"Meine persönlichen Daten:\n"
                            +"Vorname: "+empersData[0]+"\n"
                            +"Zuname: "+empersData[1]+"\n"
                            +"Alter: "+empersData[2]+"\n"
                            +"Blutgruppe: "+empersData[3]+empersData[4]+"\n";
                            /*+"Versicherungsnr: "+empersData[5]+"\n"
                            +"Geschlecht: "+empersData[6]+"\n";*/
                    SmsManager sms = SmsManager.getDefault();
                    Log.i("nr","Telefonnr 1: "+ emerNumbers[i]);
                    Log.i("text",text);
                    sms.sendTextMessage(emerNumbers[i], null, text, null, null);
                    //Toast.makeText(this, "SOS versendet", Toast.LENGTH_LONG).show();
                        Log.i("onClickTest", "Überprüfung Index: "+ischecked[i]);   
</code></pre>

<p>the methode "sms.sendTextMessage" throws the NullPointerException!</p>
