how to quit a loop or onClick(android)?
<p>Got a problem here on exiting onclick.</p>

<p>The program uses shared preferences to get inputs,
and if <code>String name = "User"</code>, the program wouldn't let the user click this button and just display an alert dialog box.</p>

<p>This is my code below:</p>

<pre><code>public void onClick(View v) {                   
    name = shared.getString("sharedname", "User");
    gender = shared.getInt("sharedgender", 0);
    age = shared.getInt("sharedage", 0);
    weight =shared.getInt("sharedweight", 0);
    height = shared.getInt("sharedheight", 0);
    if(name=="User")
    {
        new AlertDialog.Builder(cont)
        .setMessage("Please input your information first")
        .setNeutralButton("OK", null).show();
        break;//error
    }
//code code code, rest of the code to be cancelle
</code></pre>
