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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:36:09+00:00 2026-06-16T00:36:09+00:00

I am developing an Android application for >= API 8. For compatibility reasons, the

  • 0

I am developing an Android application for >= API 8.

For compatibility reasons, the application uses Actionbar Sherlock. Before API 11, the NumberPicker was an internal widget, but I need the NumberPicker, so I had to come up with another solution.

After some Googling, I stumbled upon this NumberPicker from Mike Novak. I implemented it but unfortunately, when I click on the preference that should bring up the dialog with the numberpicker, the application crashes.

It seems there is something wrong with the reference to the layout (logcat says com.example.widget.NumberPicker is used) file, but the source references to com.michaelnovakjr.numberpicker.R.layout.pref_number_picker as you can see here.

LogCat output:

12-13 13:59:27.516: W/dalvikvm(11642): threadid=1: thread exiting with uncaught exception (group=0x40dbe930)
12-13 13:59:27.555: E/AndroidRuntime(11642): FATAL EXCEPTION: main
12-13 13:59:27.555: E/AndroidRuntime(11642): android.view.InflateException: Binary XML file line #24: Error inflating class com.michaelnovakjr.numberpicker.NumberPicker
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.createView(LayoutInflater.java:613)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.preference.DialogPreference.onCreateDialogView(DialogPreference.java:343)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.preference.DialogPreference.showDialog(DialogPreference.java:287)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.preference.DialogPreference.onClick(DialogPreference.java:266)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.preference.Preference.performClick(Preference.java:949)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:215)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.widget.AdapterView.performItemClick(AdapterView.java:298)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.widget.AbsListView.performItemClick(AbsListView.java:1100)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:2749)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.widget.AbsListView$1.run(AbsListView.java:3423)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.os.Handler.handleCallback(Handler.java:725)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.os.Handler.dispatchMessage(Handler.java:92)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.os.Looper.loop(Looper.java:137)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.app.ActivityThread.main(ActivityThread.java:5039)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at java.lang.reflect.Method.invokeNative(Native Method)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at java.lang.reflect.Method.invoke(Method.java:511)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at dalvik.system.NativeStart.main(Native Method)
12-13 13:59:27.555: E/AndroidRuntime(11642): Caused by: java.lang.reflect.InvocationTargetException
12-13 13:59:27.555: E/AndroidRuntime(11642):    at java.lang.reflect.Constructor.constructNative(Native Method)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.createView(LayoutInflater.java:587)
12-13 13:59:27.555: E/AndroidRuntime(11642):    ... 23 more
12-13 13:59:27.555: E/AndroidRuntime(11642): Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class com.example.widget.NumberPickerButton
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.inflate(LayoutInflater.java:459)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at com.michaelnovakjr.numberpicker.NumberPicker.<init>(NumberPicker.java:125)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at com.michaelnovakjr.numberpicker.NumberPicker.<init>(NumberPicker.java:117)
12-13 13:59:27.555: E/AndroidRuntime(11642):    ... 26 more
12-13 13:59:27.555: E/AndroidRuntime(11642): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.widget.NumberPickerButton" on path: /data/app/nl.livecarb.android-1.apk
12-13 13:59:27.555: E/AndroidRuntime(11642):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.createView(LayoutInflater.java:552)
12-13 13:59:27.555: E/AndroidRuntime(11642):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
12-13 13:59:27.555: E/AndroidRuntime(11642):    ... 31 more

res/xml/main_preferences.xml

    <?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/nl.livecarb.android" >

    <PreferenceCategory android:title="@string/pref_cat_title_medical" >
        <com.michaelnovakjr.numberpicker.NumberPickerPreference
            android:key="@string/pref_key_ratio"
            android:summary="Bla"
            android:title="@string/pref_title_ratio"
            picker:defaultValue="1"
            picker:endRange="31"
            picker:startRange="1" />
    </PreferenceCategory>
    <PreferenceCategory android:title="@string/pref_cat_title_other" >
        <Preference
            android:key="@string/pref_key_disclaimer"
            android:title="@string/pref_title_disclaimer" />
    </PreferenceCategory>

</PreferenceScreen>

SettingsActivity.java

public class SettingsActivity extends PreferenceActivity implements OnPreferenceClickListener {

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

        if(android.os.Build.VERSION.SDK_INT >= 11) {
            getFragmentManager().beginTransaction().replace(android.R.id.content, new SettingsFragment(), "settings").commit();
        } else {
            addPreferencesFromResource(R.xml.main); 
        }
    }

    class SettingsFragment extends PreferenceFragment {

        private Preference preferences = null;

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

            addPreferencesFromResource(R.xml.main);

            preferences = findPreference(getResources().getString(R.string.pref_key_disclaimer));
            preferences.setOnPreferenceClickListener(SettingsActivity.this);
        }
    }
}

The error
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.widget.NumberPickerButton" on path: /data/app/nl.livecarb.android-1.apk doesn’t make any sense to me, since I never used com.example.widget.NumberPickerButton. Neither the NumberPicker lib does.

Things I did trying to solve this problem:

  1. How to use NumberPicker from QuietlyCoding in preferences?
  2. Double checked the library project is referenced correct
  3. Cleaned the project (including all libs)

Any thoughts?

  • 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-16T00:36:10+00:00Added an answer on June 16, 2026 at 12:36 am

    Are you working off the master branch of the project? Try searching your code for a reference to that example package. I just took a look in the library and I don’t see any reference to it.

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

Sidebar

Related Questions

I am currently developing an android application uses Google map API. I am wondering
I am developing an Android application which makes use of the Osmdroid maps api.
I am developing an Android application. Here I'm integrating the facebook api to my
I'm developing android application for CAR usage and I need that in phone or
I started developing an Android application that record a video and I need to
Hello i am new in developing Android applications, I need to create an application
I am developing an application called reminder using android API. My Application reminds every
I am developing an Android application using Eclipse and APT. Now I need to
Im developing an application which is dealing with the android contacts API. I implemented
I have been developing an application to target Android API level 10. When i

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.