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

  • Home
  • SEARCH
  • 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 6541455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:06:26+00:00 2026-05-25T11:06:26+00:00

I need to build an application to three types of users: Beginner, Intermediate and

  • 0

I need to build an application to three types of users: Beginner, Intermediate and Advanced. Each level has a specific XML messages (written according to the user level) and will be charged in terms of performance. If the user sets the level PreferencesActivity Advanced, XML load application to display messages from this user-level …

How do I build it correctly?

onCreate () always invoke the XML level and pre-configured in Preferences Shared? I think this is a bad idea …

Thank you!
Mateus!

  • 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-25T11:06:27+00:00Added an answer on May 25, 2026 at 11:06 am

    On the first run, you could have the user choose whether they’re Beginner, Intermediate, or Advance using 3 different buttons. Then in the onClick save to SharedPreferences which they chose, then in onCreate get what they chose and set accordingly. Here’s what I mean:

    Button beginnerButton = (Button)findViewById(R.id.beginnerButton);
    beginnerButton.setOnClickListener(new View.OnClickListener() {
    
            @Override
            public void onClick(View arg0) {
                SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(); 
                                SharedPreferences.Editor editor = pref.edit();
                              editor.putInt("level", 1);
            }
        }); 
    

    You would do the same for the other two buttons, but make intermediate putInt(..., 2), and advanced putInt(..., 3)

    Then in your PreferenceActivity in onCreate

    SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences();
    Int level = pref.getInt("level", 1);
    if (level==1)
       addPreferencesFromResource(R.layout.beginner);
    else if (level==2)
       addPreferencesFromResource(R.layout.intermediate);
    else addPreferencesFromResource(R.layout.advanced);
    

    I’d say that’s probably the easiest way to handle it.

    If you have to set click listeners and things, though, it may be better to use three different activities with the same premise. You would have a start screen that would get “level” from sharedprefs and then startActivity(...) based on what was returned.

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

Sidebar

Related Questions

Do I really need Visual studio to build c/C++ application on Windows. Is there
I need to build an application which will run on OS X, polling for
I need to build my application GUI using HTML/CSS/JavaScript with a C++ backend all
I need to build an application that accepts user input data (such as name,
I need to build a web application with different process flows and different UI
I need to build my QT console application as 64 bit. i.e. x86_64 My
We need to build an administration portal website to support our client/server application. Since
I need to build a simple, single user database application for Windows. Main requirements
For homework, I need to build a small java application.The main goal is to
I need to build several Rails applications for one client. I would like to

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.