Custom title bar with Image view for TabActivity
<p>Dear all I am using following code to create the custom title with image view.But it shows the null pointer exception for the imageview. How to solve this ?</p>

<pre><code>    public class MyCustomTab2Activity extends TabActivity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); 
                    //Tab Content
        setContentView(R.layout.my_tab_home);       
        ImageView imag = (ImageView) findViewById(R.id.iv_logout);         
        imag.setOnClickListener( new OnClickListener() {

        @Override
        public void onClick(View v) {

        }
        });
                    //custom title bar content
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.logintitle); 

        ......


        ...........


    }

}
</code></pre>
