Android dialog help!
<p>I have a question that i hope you guys can help me with!</p>

<p>This code, creates a dialog and in the dialog theres a button and a seekbar.</p>

<p>When I set the seekbar setonseekbarchangelistener i get an Nullpointerexception error. And I dont know why!
(Uncomment seekbar.setOnSeekBarChangeListener(this) to get error)</p>

<pre><code>    public class seekActivity extends Activity implements OnClickListener,   OnSeekBarChangeListener  {
       SeekBar seekbar;
        Button button;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //set up main content view
        setContentView(R.layout.main);
        //this button will show the dialog
        Button button1main = (Button) findViewById(R.id.Button01main);


        button1main.setOnClickListener(this);

    }
        public void onClick(View v) {
                //set up dialog
                Dialog dialog = new Dialog(this);
                dialog.setContentView(R.layout.maindialog);
                dialog.setTitle("This is my custom dialog box");
                dialog.setCancelable(true);
                 button = (Button) dialog.findViewById(R.id.Button01);
                seekbar = (SeekBar) findViewById(R.id.seekBar1);
                //seekbar.setOnSeekBarChangeListener(this);
                dialog.show();

        }
        @Override
        public void onProgressChanged(SeekBar seekBar, int progress,
                boolean fromUser) {
            // TODO Auto-generated method stub

        }
        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub

        }
        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {
            // TODO Auto-generated method stub

        };


            }
</code></pre>
