Activity does not finish even after using return statement or finish call
<p>Following is an onclick method called when a button is clicked. But the code doesn't stop my application. It sends a message and then closes and then restarts again.. I have read the lifecycle model of an activity and fyi this is a single activity application. I also researched on stackoverflow, many of the post describing to have a return statement after finish() call so i have done that too but no results.</p>

<p>Where am i going wrong ???</p>

<pre><code>public void onClick(View v) 
    {       
        String text = "Demo Message";

        String number = &lt;set via a particular code&gt;;


        if(number.equals(""))
        {
            Toast.makeText(this, "Please Enter or Select a Number", Toast.LENGTH_SHORT).show();
        }
        else
        {
            sms = SmsManager.getDefault();
            PendingIntent sentIntent = PendingIntent.getActivity(this, 0,
                new Intent(this, Main.class), 0);

            sms.sendTextMessage(number, null, text, sentIntent, null);
            Toast.makeText(this, "Message Sent to : " + number, Toast.LENGTH_SHORT).show();

            // Stop the Activity...
            finish();           
            return;
        }   
    }
</code></pre>
