title: How to removeDialog(int dialogID) Android?
body: <p>I have extended my class with a dialog in which I have set content view and other button actionlisteners etc... what is happening is that when I create my dialog it shows background properly.</p>
  
  <p>but opening it again and again is crating problems with content view, things are added haphazardly and most of the UI elements are repeating and background image is disappeared.</p>
  
  <p>I know that dialog is created once and is used as a cache, I don't want that I know there is a method in Android Activity removeDialog(int dialogID) but I don't know who to use this, I don't give any id to my dialog I don't know how to give id to dialog.</p>
  
  <pre><code>#dialog code
  
  public class OptionsDailog extends Dialog implements OnClickListener {
          public OptionsDailog(Activity pContext) {
          super(pContext, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
          mContext = pContext;
          setContentView(R.layout.option_menu);
          setBasicContents();
      }
  
  #options_menu.xml
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" android:id="@+id/rl_root_option_menu"&gt;
      &lt;RelativeLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:background="@drawable/bg_episode" android:id="@+id/rl_option_screen"&gt;
          &lt;LinearLayout android:id="@+id/ll_options" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true"&gt;
              &lt;Button android:text="Achievements" android:textSize="18sp" android:id="@+id/btn_achievements" android:background="@drawable/bg_options_menu" android:textColor="#FFFFFF" android:layout_width="250dp" android:layout_height="60dp"&gt;&lt;/Button&gt;
              &lt;Button android:text="Tutorial" android:textSize="18sp" android:id="@+id/btn_tutorial" android:background="@drawable/bg_options_menu" android:textColor="#FFFFFF" android:layout_width="250dp" android:layout_height="60dp"&gt;&lt;/Button&gt;
              &lt;Button android:text="Leaderboard" android:textSize="18sp" android:id="@+id/btn_leaderboard" android:background="@drawable/bg_options_menu" android:textColor="#FFFFFF" android:layout_width="250dp" android:layout_height="60dp"&gt;&lt;/Button&gt;
              &lt;Button android:id="@+id/btn_music" android:text="Music" android:textSize="18sp" android:background="@drawable/bg_options_menu" android:textColor="#FFFFFF" android:layout_width="250dp" android:layout_height="60dp"&gt;&lt;/Button&gt;
              &lt;Button android:id="@+id/btn_sound" android:textSize="18sp" android:text="Sound" android:layout_marginBottom="10dip" android:background="@drawable/bg_options_menu" android:textColor="#FFFFFF" android:layout_width="250dp" android:layout_height="60dp"&gt;&lt;/Button&gt;
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
      &lt;ImageButton android:background="@drawable/btn_back" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:layout_marginRight="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/ib_back_options_menu"&gt;&lt;/ImageButton&gt;
  &lt;/RelativeLayout&gt;
  
  #Dialog showing code
  final OptionsDailog mDailog = new OptionsDailog(JungleCrashLand.this);
              mDailog.show();
  </code></pre>