Checking if a View == null before setting onClickListener
<p>I usually create the <code>initialize()</code> function and functions for setting on-click listeners, and then I call these functions from an Activity's <code>onCreate()</code>. When I call <code>someView.setOnClickListener(...)</code> in a function, should I check if the <code>someView == null</code> or not? I know, that it <code>!= null</code>, but I need an advice about coding style. Which is the best practice?<br />
Here is an example:</p>

<pre><code>...
public class SomeActivity extends Activity
{
    private ImageButton someButton;
    private Intent someIntent;

    public void onCreate(Bundle icicle)
    {
        super.onCreate(icicle);
        setContentView(R.layout.add_alarm);        
        initialize();
        setSomeButtonHandler();
    }

    public void initialize()
    {
        someButton = (ImageButton) findViewById(R.id.someButton);
    }

    public void setSomeButtonHandler()
    {
        if(someButton != null) //Should I check this?
        {
            someIntent = new Intent(SomeActivity.this, SomeButtonActivity.class);
            someButton.setOnClickListener(new View.OnClickListener()
            {
                public void onClick(View v)
                {
                    startActivity(someIntent);
                }
           });
        }   
    }
}
</code></pre>
