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 8627103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:11:36+00:00 2026-06-12T08:11:36+00:00

Possible Duplicate: How to change the Font Size in a whole Application programmatically, Android?

  • 0

Possible Duplicate:
How to change the Font Size in a whole Application programmatically, Android?

This is my Code : I have created Spinner with a list of FontSize options. If I click FontSize “26” then it should be able to change in that specific FontSize. Below I have an EditBox. So if I clicked Fontsize as 40 and in a Italic style than usual Bold. So I should be able to type inside EditBox with this selected “Font” : FontSize “40” and Italic style.

How could I do this programmatically in Android?

font=new Spinner(con);
option= new String[] {"Select Font Size","8","10","12","14","16","18","20",
                      "22","24","26","28","30","32","34","36","38","40","50"};
ArrayAdapter<String> adapter= new ArrayAdapter<String>(con,android.R.layout.simple_spinner_dropdown_item,option);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

font.setOnItemSelectedListener(new OnItemSelectedListener() {
    @Override
    public void onItemSelected(AdapterView<?> arg0, View arg1,int position, long id) {
        option[1]="8";
       selectedItem= option[position];
    }
    @Override
    public void onNothingSelected(AdapterView<?> arg0) {
    }
});
  • 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-12T08:11:37+00:00Added an answer on June 12, 2026 at 8:11 am

    to change

    textSize use editText.setTextSize(20)

    font and style use editText.setTypeface(yourTypeFace, Typeface.BOLD)

    UPDATE

    public class MyEditText extends EditText{
    
    public MyEditText(Context context) {
        super(context);
        init();
    }
    
    public MyEditText(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        init();
    }
    public MyEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
        init();
    }
    void init() {
       this.setTextSize(20);
       this.setTypeface(yourTypeFace, Typeface.BOLD);
    }
    
    // method to change font settings
    void setFont(TypeFace tf){
       this.setTypeFace(tf);
    }
    //add whatever method you want
    }
    

    and then instead of using EditText you use this class, and don’t forget in your XML to use

    <yourpackage.MyEditText
         android:layout_height=".."
         android:layout_width=".."
         ... />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: ToggleButton state change programmatically rather than automatically in Android? I am trying
Possible Duplicate: Why does the background of TextView change it's size? I have a
Possible Duplicate: how to change the font on the text view in android? I
Possible Duplicate: Change language programatically in Android I am creating Application which is a
Possible Duplicate: Android: change default Home Application I want to create a program like
Possible Duplicate: change layout and template in zend dynamically according to the device(android tab,iphone,ipad)
Possible Duplicate: Flip-Animation for Activity-Change I'm new to Android Animation . I wanted to
Possible Duplicate: Android Button: set onClick background image change with XML? I need that
Possible Duplicate: php edit for Cufon font replacement I am reposting this due to
Possible Duplicate: How do i programmatically change file permissions? How can I set the

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.