title: I couldn't see the java.lang.NullPointerException error
body: <p>Can Anyone help me please? explain to me why this code is "java.lang.NullPointerException" error.</p>
  
  <pre><code>final ImageButton sampleImageButton = (ImageButton) findViewById(R.id.btn_sample);
  
      final Dialog dd_dialog = new Dialog(MainActivity.this);
      dd_dialog.setContentView(R.layout.Sample_layout);
      dd_dialog.setTitle("Sample");
      dd_dialog.setCancelable(true);
  
  sampleImageButton.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
                      dd_dialog.show();
                  }
              });
  </code></pre>
  
  <p>here's the xml</p>
  
  <pre><code>&lt;Button android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:id="@+id/btn_sample"
          android:text="Sample"
          android:background="#4372AA"
          android:layout_marginRight="10dp"
          android:paddingLeft="10dp"
          android:paddingRight="10dp"
          android:textColor="#FFFFFF"
          android:layout_marginTop="30dp"/&gt;
  </code></pre>