Android application force close

后端 未结 1 1409
自闭症患者
自闭症患者 2021-01-25 02:56

Trying to send a text message more than 100 times, is there any way to override the SMSDispatcher text limitation?

Here\'s the error:

08-02 03:34:07.927:         


        
相关标签:
1条回答
  • 2021-01-25 03:37

    You can't compare string with == try this

    if (TxtCount.getText().toString().equals(""))
    {
        Toast.makeText(getApplicationContext(), "Please enter a number of times to nuke!", Toast.LENGTH_SHORT).show();
    }
    else if (num.queals(""))
    {
        Toast.makeText(getApplicationContext(), "Please enter a phone number to nuke!", Toast.LENGTH_SHORT).show();
    }
    else if (msg.equals(""))
    {
        Toast.makeText(getApplicationContext(), "Please enter a message!", Toast.LENGTH_SHORT).show();
    }
    
    while (count <= max) 
    {                  
        sendSMS(""+num,""+ msg);
        count++;
    };
    

    Like this

    else if (num.equals(""))
    {
        Toast.makeText(getApplicationContext(), "Please enter a phone number to nuke!", Toast.LENGTH_SHORT).show();
        return;
    }
    
    0 讨论(0)
提交回复
热议问题