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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:14:09+00:00 2026-05-23T14:14:09+00:00

I currently have an application where the french users should have a preference set

  • 0

I currently have an application where the french users should have a preference set to false by default and the other one should have this preference set to true.

I don’t understand a correct and clean way to handle that.

Currently , in my app, I call 2 times the preference.

*) first time in my preference xml layout and in my preference activity, I have to set the preference at the first launch.

*) Second time, in my code:

boolean value = prefs.getBoolean("key"), true/false);

Thanbk a lot for all your ideas and explanations on how to make this in a clean way.

  • 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-23T14:14:10+00:00Added an answer on May 23, 2026 at 2:14 pm

    You can use resources in such a way to accomplish this.

    Folder structure (you can probably pick whatever name you want for the actual XML file or even create the resource with other resources):

    /res/values/bools.xml
    /res/values-fr/bools.xml
    

    In /res/values/bools.xml:

    • Make the boolean, you can rename this to whatever you need.
      • Name: pref_default
      • Type: boolean
      • Value: true

    In /res/values-fr/bools.xml:

    • Make the boolean again, same name
      • Name: pref_default
      • Type: boolean
      • Value: false

    In your preferences.xml:

    • Set the default value to @bool/pref_default

    All set!

    You should even be able to access that from code with R.bool.pref_default.

    Disclaimer: I have never written code that involved multiple languages, but I have based this on my understanding of resource qualifiers.

    If you mean the region France and not the French speakers, then you can probably find a -r qualifier for it (see my link).

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

Sidebar

Related Questions

I currently have an application that gets hit with over 20,000 users daily and
I currently have an application that for a set of parameters (location, category, budget,
Currently I have an application used to update my software, this is a standalone
Currently i have an application that reads and writes several properties from one or
I currently have a Pylons application running with a basic user system set-up. I
We currently have an application that sends out SMS to users, it acts like
I currently have my application set up with a ListFragment on the left and
Currently I have one application in which I am able to access .mdb or
I currently have a single solution that contains both the one application developed so
I currently have an application which needs to have an awareness of which monitor

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.