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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:50:02+00:00 2026-06-15T16:50:02+00:00

I want to apply InputFilter to my EditTextPreferences… Before I used the PreferenceActivity I

  • 0

I want to apply InputFilter to my EditTextPreferences…

Before I used the PreferenceActivity I had EditTexts with Filters like that:

            et1 = (EditText) findViewById(R.id.editText1);
            et2 = (EditText) findViewById(R.id.ETminsim);
            et3 = (EditText) findViewById(R.id.ETdelay);

            et1.setText(Integer.toString(PlotView.playlist_size), EditText.BufferType.EDITABLE);

            et2.setText(Integer.toString(conversorToInt(PlotView.min_sim)), EditText.BufferType.EDITABLE);
            et3.setText(Integer.toString(MusicService.getSeek()/1000), EditText.BufferType.EDITABLE);

            et1.setFilters(new InputFilter[]{ new InputFilterMinMax(1, 30)});
            et2.setFilters(new InputFilter[]{ new InputFilterMinMax(0, 100)});
            et3.setFilters(new InputFilter[]{ new InputFilterMinMax(0, 300)});

But how can I reference to the EditTexts of the EditTextPreference in order to set these Filters?

My new Code:

public void onCreate(Bundle bundle) {
                 super.onCreate(bundle);

                 getPreferenceManager().setSharedPreferencesName(Singleton.PREFS_NAME);
                 addPreferencesFromResource(R.xml.prefs);

                 //TODO set InputFilter
}
  • 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-15T16:50:03+00:00Added an answer on June 15, 2026 at 4:50 pm

    Konstantin had it mostly correct. Combine his answer with Sebastian’s comment on his answer and you get

    EditText editText1 = ((EditTextPreference) findPreference(preference_1_key))
                             .getEditText();
    editText1.setFilters(new InputFilter[]{ new InputFilterMinMax(1, 30) });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to apply an activities transition like the one that HTC phones have:
i want to apply masking over the textinput that need to get SSN from
I want to apply a Storyboard to my Rectangle Fill like this: <Rectangle Name=MyRectangle
I want to apply a rewrite condition, so that only *.php files are affected:
I want to apply something like this a:visited{background-color:#0F0;} to all <a> tags, if at
I want to apply a class-name like current to an actionlink (in the master
I want to apply a change so That I can use Server GC settings
I want to apply a search and replace regular expression pattern that work only
I want to apply vignette and vintage image filters on my image. I followed
I want to apply Custom CSS into external webpage in WebView just like follow

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.