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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:44:07+00:00 2026-06-03T13:44:07+00:00

I have an app with 3 activites. At my opening activity (main activity), I

  • 0

I have an app with 3 activites. At my opening activity (main activity), I set the fonts for my app with the static keyword so I can reuse it. The 2 other activites get their fonts from the main activity. This pose a probelm – when a user is in lets say, activity number 3 and then return to home (desktop), without closing the application and then reopen the application – he will get the default fonts and not my custom one.

That means I will have to initilize the TypeFace in each activity in order to avoid that. My question is, what is the right to do it? should I initialize them in each activity? should I put the fonts in my main activity inside of a method and just call that method from the different activities? any other way I’m missing here?

  • 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-03T13:44:09+00:00Added an answer on June 3, 2026 at 1:44 pm

    If number of different types of views for which you want to set the custom font is small (say only TextView), follow Custom Fonts in Android Widgets to understand how you can do it in XML, so that you do not have to do it in every activity.

    If you really want to share the TypeFace across activities, the recommended way would be to create a sub-class of Activity which contains the TypeFace as a member variable. You would have to then use this class as the parent of all your activities.

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

Sidebar

Related Questions

I have an app which has a main activity that calls other activities on
In my Android app, I have a main activity that serves as an entry
I have three activities in my app: .OpeningScene: An opening activity that contains my
I have an app with 3 activities. I have the main activity. This calls
I have an app with four activities. I have set the intent-filter on one
I have a app with 2 tabbed activities, and I'm trying to get SharedPreferences
I have an app that contains several activities...so lets say user is navigating activity
I have an app that so far consists of two Activities: The Main Menu
If I have two activities in my app, one with listview and the other
I have this code: package com.powergroupbd.timer; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.os.CountDownTimer;

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.