Toast staying on screen for over a minute
<pre><code>// ---sends an SMS message to another device---
private void sendSMS(String phoneNumber, String message) {
    int i;
    SmsManager sms = SmsManager.getDefault();
    int amount = 10; // just making 10 the default if the EditText has an
                        // invalid value
    try {
        amount = Integer.parseInt(smsamount.getText().toString());
    } catch (NumberFormatException smsamount) {
    }

    for (i = 0; i &lt; amount; i++) {

        if (amount &lt; 100)
            sms.sendTextMessage(phoneNumber, null, message, null, null);

        else
            Toast.makeText(getBaseContext(),
                    "Please enter an amount less than 100.",
                    Toast.LENGTH_SHORT).show();
    }

}
</code></pre>

<p>This works, but the toast is staying on the screen for over a minute. It stays on the screen even after exiting the app. I have tried changing the toast to before the process to send the messages, but it force closes the app. Is this something that I am going to have to use the hack located here: <a href="http://thinkandroid.wordpress.com/2010/02/19/indefinite-toast-hack/" rel="nofollow">http://thinkandroid.wordpress.com/2010/02/19/indefinite-toast-hack/</a> to make it shorter?</p>
