title: Custom Text For Dialog implements OnClick Listener Android
body: <p>Friends I just Wanna set Custom Typeface Form my assets/fonts folder 
  My Java Code Looks like this</p>
  
  <pre><code>package customtext;
  import android.app.Dialog;  
  import android.content.Context;  
  import android.os.Bundle;  
  import android.view.View;  
  import android.view.Window;
  import android.widget.Button;
  public class Custom extends Dialog implements android.view.View.OnClickListener{  
      public Custom(Context context) {  
          super(context);
          requestWindowFeature(Window.FEATURE_NO_TITLE);
  }  
  Button btn;  
      @Override  
      protected void onCreate(Bundle savedInstanceState) {  
          super.onCreate(savedInstanceState);  
          setContentView(R.layout.custom);  
          btn=(Button) findViewById(R.id.dismis_dialog);  
          btn.setOnClickListener(this);  
      }  
      @Override  
      public void onClick(View v) {  
          dismiss();  
      }  
  }  
  </code></pre>
  
  <p>When I try to add like <a href="https://stackoverflow.com/questions/10061494/android-getassets-in-common-class-gives-the-method-getasssets-is-undefined-fo">this</a>  Its not worked for me </p>
  
  <p>its giving error</p>
  
  <p>here this is my XML</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;  
     &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
     android:layout_width="fill_parent"  
     android:layout_height="fill_parent"   
     android:orientation="vertical"
     style="@style/Theme.CustomDialog"   &gt;
  
         &lt;FrameLayout
             android:layout_width="250sp"
             android:layout_height="70sp"
             android:background="#ee8f03" &gt;
              &lt;TextView
                   android:layout_width="180sp"  
                   android:layout_height="wrap_content"   
                   android:id="@+id/sharedialog"
                   android:text="@string/msg"  
                   android:textColor="#272b2d"
                   android:background="#ef8e01"
                   android:layout_gravity="center" &gt;  
              &lt;/TextView&gt;  
         &lt;/FrameLayout&gt;
  
         &lt;FrameLayout
             android:layout_width="250sp"
             android:layout_height="70sp"
             android:background="#fff" &gt;
  
             &lt;Button 
               android:layout_width="wrap_content"  
               android:layout_height="wrap_content"  
               android:layout_gravity="bottom"
               android:clickable="true" 
               android:id="@+id/dismis_dialog"  
               android:text="@string/dismis"/&gt; 
         &lt;/FrameLayout&gt;
  
    &lt;/LinearLayout&gt;  
  </code></pre>
  
  <p>Would you please tell how to add custom font to this type of context Dialog Box</p>
  
  <p>Thank you</p>