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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:11:25+00:00 2026-06-12T13:11:25+00:00

I am trying to use QuietlyCoding NumberPicker because I haven´t found any other but

  • 0

I am trying to use QuietlyCoding NumberPicker because I haven´t found any other but I can´t get it working.
I imported the library as a project and then I add it to my project:

Preference Activity:

public class MainPrefs extends PreferenceActivity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        PreferenceManager preferenceManager = getPreferenceManager();
        preferenceManager.setSharedPreferencesMode(MODE_PRIVATE);
        preferenceManager.setSharedPreferencesName("numberPicker.preferences");

        this.addPreferencesFromResource(R.xml.main_preferences);

        this.findPreference("SMSSentLimit").setOnPreferenceChangeListener(new OnPreferenceChangeListener(){
            @Override
            public boolean onPreferenceChange(Preference preference, Object newValue) {
                TrackerService.updateStats(Long.decode(newValue.toString()));
                return true;
            }
        });
    }

}

main_preference.xml

<PreferenceCategory android:title="General" >
    <EditTextPreference
        android:defaultValue="0"
        android:title="@string/SMSSentLimitTitle"
        android:key="SMSSentLimit"
        android:summary="@string/SMSSentLimitSummary" 
        android:inputType="number" />
    <com.michaelnovakjr.numberpicker.NumberPickerPreference
        android:key="demo.preference"
        android:title="Sample Number Picker"
        android:summary="Number picker as a preference"
        picker:defaultValue="15"
        picker:startRange="-50"
        picker:endRange="50" />
</PreferenceCategory>

I can´t compile my project on this way, to compile my project I have to edit my .xml on this way:

    <com.michaelnovakjr.numberpicker.NumberPickerPreference
        android:key="demo.preference"
        android:title="Sample Number Picker"
        android:summary="Number picker as a preference" />

Removing defaultValue, startRange and endRange, on this way my project is compiled and I can see my preference but when I click it I get force close because I didn´t define the values. Why I can add this values ? Have anyone worked whit this library ?

Thank you

  • 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-12T13:11:26+00:00Added an answer on June 12, 2026 at 1:11 pm

    You need to add the schema for the library attributes, in the top level of your preferences xml file. It should look something like this – the second/third lines are the important ones.

    <?xml version="1.0" encoding="utf-8"?>
    <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:picker="http://schemas.android.com/apk/res/[com.yourpackagename]">
        <PreferenceCategory android:title="General" >
            <EditTextPreference
                android:defaultValue="0"
                android:title="@string/SMSSentLimitTitle"
                android:key="SMSSentLimit"
                android:summary="@string/SMSSentLimitSummary" 
                android:inputType="number" />
            <com.michaelnovakjr.numberpicker.NumberPickerPreference
                android:key="demo.preference"
                android:title="Sample Number Picker"
                android:summary="Number picker as a preference"
                picker:defaultValue="15"
                picker:startRange="-50"
                picker:endRange="50" />
        </PreferenceCategory>
    </PreferenceScreen>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying use cursor for pagination. Forwarding pagination work fine, but I can
I am trying use javascript regular expressions to do some matching and I found
I am trying use filehelpers class builder but I am kinda confused on what
I was trying use svn to find a checkin using svn log, but it
I am trying use std::copy to copy from two different iterator. But during course
I'm trying use the Sum method in a lambda expression for a comparison, but
I am trying use TinyMCE to get code syntax to be displayed in the
I am trying use Thread but i have some problem (I am beginner at
I'm trying use double type in openCL, but doesn't work anyway, i want use
I'm working with VS2010 express on Win7 (64 bit) and I'm trying use System.ServiceModel

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.