If condition not working in android intent activity
<p>I'm new to Android. I need to start a new intent activity based on if condition, but
the if condition is not working, but the value gets printed in the log file.</p>

<p>the code that I use is given below:</p>

<pre><code>package com.example.helloandroid;

public class Main extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        ImageButton next2 = (ImageButton)findViewById(R.id.imageButton1);
        next2.setOnClickListener(new View.OnClickListener() {
            public void onClick(View view) {
                EditText pin =(EditText)findViewById(R.id.editText1); //value from edit text

                Log.v("EditText", pin.getText().toString()); //this works in log

                if (pin.equals(0000)){
                    Intent myIntent = new Intent(view.getContext(), home.class);
                    startActivityForResult(myIntent, 1);
                }
            }
        });
    }

    @Override
    public void onBackPressed() {
        return;

    }
}
</code></pre>
