Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9261671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:11:23+00:00 2026-06-18T13:11:23+00:00

Friends I just Wanna set Custom Typeface Form my assets/fonts folder My Java Code

  • 0

Friends I just Wanna set Custom Typeface Form my assets/fonts folder
My Java Code Looks like this

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();  
    }  
}  

When I try to add like this Its not worked for me

its giving error

here this is my XML

    <?xml version="1.0" encoding="utf-8"?>  
   <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"   >

       <FrameLayout
           android:layout_width="250sp"
           android:layout_height="70sp"
           android:background="#ee8f03" >
            <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" >  
            </TextView>  
       </FrameLayout>

       <FrameLayout
           android:layout_width="250sp"
           android:layout_height="70sp"
           android:background="#fff" >

           <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"/> 
       </FrameLayout>

  </LinearLayout>  

Would you please tell how to add custom font to this type of context Dialog Box

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T13:11:24+00:00Added an answer on June 18, 2026 at 1:11 pm

    check out this links for creating Custom Dialog

    http://www.mkyong.com/android/android-custom-dialog-example/

    also you can set the custom font like this way

    Typeface type = Typeface.createFromAsset(getAssets()/fonts, "myfonts.ttc");
    youTextView.setTypeface(type);
    

    put your fonts into fonts folder under assets dir

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, I have this array of a users friends, and I'm just wondering how
Hi Friends i just Added TabbarController with UISplitViewController and relevant DetailsViewController using Bellow Code:-
Friends, i have created a UILabel with border (just like the image below). I
Just trying to make sure I have understood friends properly with this one class
I've just updated Facebook framework and old code for invite friends does't work(Now there
This might seem simple but it's just stumbled me and my friends... lets take
Just wanna ask what is the code to upload image to database is it
some friends just finished the implementation of an app and they use Custom Exceptions.
Rather than just grabbing the user's friends' emails, I want to show their list
I just created an iPhone app and am having friends try it out, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.