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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:14:10+00:00 2026-05-15T17:14:10+00:00

How can I find my PreferenceActivity instance, which was created by a framework? *

  • 0

How can I find my PreferenceActivity instance, which was created by a framework?

*
*
*

My first class.

/** This is MyAppSettings class, The instance of this class will be created by a framework **/

public class MyAppSettings extends PreferenceActivity {
    protected MySeekBarPreference mSeekBarPref;

    @Override
    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        addPreferencesFromResource(R.xml.prefs);

        mSeekBarPref = (MySeekBarPreference)super.findPreference("my_key");
    }
}

*
*
*

My second class.

public class MySeekBarPreference extends DialogPreference implements SeekBar.OnSeekBarChangeListener {

      // in whis code I need to get the instance of the MyAppSettings, which was
      // created by Android framework. (I paste a hypothetical func getTheInstanceOfMyAppSettings() :))
  private MyAppSettings mAppSettings = getTheInstanceOfMyAppSettings(); 

Can I find it by ID or something else?

  • 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-15T17:14:11+00:00Added an answer on May 15, 2026 at 5:14 pm

    I guess that you are looking for getPreferenceScreen()

    You can use it to modify the PreferenceScreen that was defined in the xml.

    For example:

    private void disableHardKeyboardOptions() {
        Preference pref = getPreferenceScreen().findPreference("pref_hardkeyboard_option");
        pref.setEnabled(false);
        pref.setSummary(custom.getString(R.string.pref_no_hardkeyboard));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can find why i get this error can someone help? package Android.data; public class
I can find syntax charts on this on the SQLite website, but no examples
I can find many examples on how to do this in managed c++ but
I've been searching for this for quite a while but can't seem to find
I can find repeated words in text with this function: $str = 'bob is
I can find documentation for their super class JApplication, but I can't find documentation
I can find lots of information on how Long Polling works (For example, this
I can find out where Firefox is installed as follows; query this key to
You can find the source code demonstrating this issue @ http://code.google.com/p/contactsctp5/ I have three
You can find my jQuery in this fiddle http://jsfiddle.net/qSkZW/9/ where the value changes based

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.