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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:51:22+00:00 2026-05-23T09:51:22+00:00

I have this Android app that’s localized in several languages. If the appropriate string

  • 0

I have this Android app that’s localized in several languages. If the appropriate string for the device’s locale exists, the app automatically displays it. So far, so good.

Next, I want to allow the app’s users to switch to one of the languages I’ve provided. I can do this by overriding the default locale. No problem here, either.

The question here: Is there a way for me to provide a “default” option in the language list that would allow users to restore the default, automatic locale? Consider the following scenario:
1. Device’s locale is set to German. App displays everything in German.
2. User wants the app to be in French, so they change the language from inside the app, and the app turns French as a result.
3. The same user changes the device’s locale to Spanish. App is still French.
4. They select the “Default” setting. The app changes to Spanish, and keeps changing when the locale is changed.

If this isn’t doable automatically, then is there a way for me to get the device-wide locale so that I can set my app to it if my “default” option is selected?

  • 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-05-23T09:51:23+00:00Added an answer on May 23, 2026 at 9:51 am

    I resolved this issue by storing the existing setting on first run of the app (before any changes are made to the default locale). In a block that only runs the first time my app runs, I call:

    m_preferences.edit().putString(
                            MyConstants.PREFERENCE_SYSTEM_LANGUAGE,
                            getResources().getConfiguration().locale.getLanguage()
                            ).commit();
    

    Later, when I need to retrieve it:

    languageToLoad = m_preferences.getString(
                            MyConstants.PREFERENCE_SYSTEM_LANGUAGE,
                            MyConstants.LANGUAGE_DEFAULT);
    

    When changing the language, I save that in another preference and handle the updates to the view.

    Edit: After poking around a bit more, I found the system setting. I switched to using this, rather than the above code.

    Resources.getSystem().getConfiguration().locale.getLanguage();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android app that is localized for English and Spanish. When you
I have this android app that posts (http post) some data strings to my
I have an a Java Android app that calls different activities. I thought this
I have a string in an Android app that I am trying to convert
I have a Web Service and an Android application that uses this web service.
I have developed an android app that mainly targets smartphones. However in tablet emulator
I have an Android app that saves a text file directly onto the phone,
I have an Android app that uses ActionBar Sherlock. I create a menu that
I have an Android app that allows the user to record data (such as
I have a free android app that I want to now distribute as free

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.