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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:37:34+00:00 2026-05-24T22:37:34+00:00

I am trying to load an array for my list preference. It is for

  • 0

I am trying to load an array for my list preference. It is for height and so my values are ‘in’ for inches and ‘cm’ for centimeters. The preference list dialog crashes as soon as I try to open the dialog. When I change it to any string other than the item ‘in’ it works. Does anyone know why this might be happening?

Edit:

Here is my array. I did not define it as string array.

<array name="length_units">
    <item>in</item>
    <item>cm</item>
</array>

Here is the stacktrace

> W/dalvikvm(18013): threadid=1: thread exiting with uncaught exception
> (group=0x400259f8) E/AndroidRuntime(18013): FATAL EXCEPTION: main
> E/AndroidRuntime(18013): java.lang.NullPointerException
> E/AndroidRuntime(18013):  at
> android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355)
> E/AndroidRuntime(18013):  at
> android.widget.ArrayAdapter.getView(ArrayAdapter.java:323)
> E/AndroidRuntime(18013):  at
> android.widget.AbsListView.obtainView(AbsListView.java:1315)
> E/AndroidRuntime(18013):  at
> android.widget.ListView.measureHeightOfChildren(ListView.java:1198)
> E/AndroidRuntime(18013):  at
> android.widget.ListView.onMeasure(ListView.java:1109)
> E/AndroidRuntime(18013):  at android.view.View.measure(View.java:8172)
> E/AndroidRuntime(18013):  at
> android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
> E/AndroidRuntime(18013):  at
> android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
> E/AndroidRuntime(18013):  at
> android.widget.LinearLayout.measureVertical(LinearLayout.java:381)
> E/AndroidRuntime(18013):  at
> android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
> E/AndroidRuntime(18013):  at android.view.View.measure(View.java:8172)
> E/AndroidRuntime(18013):  at
> android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
> E/AndroidRuntime(18013):  at
> android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1012)
> E/AndroidRuntime(18013):  at
> android.widget.LinearLayout.measureVertical(LinearLayout.java:381)
> E/AndroidRuntime(18013):  at
> android.widget.LinearLayout.onMeasure(LinearLayout.java:304)
> E/AndroidRuntime(18013):  at
> com.android.internal.widget.WeightedLinearLayout.onMeasure(WeightedLinearLayout.java:60)
> E/AndroidRuntime(18013):  at android.view.View.measure(View.java:8172)
> E/AndroidRuntime(18013):  at
> android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
> E/AndroidRuntime(18013):  at
> android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
> E/AndroidRuntime(18013):  at android.view.View.measure(View.java:8172)
> E/AndroidRuntime(18013):  at
> android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:3140)
> E/AndroidRuntime(18013):  at
> android.widget.FrameLayout.onMeasure(FrameLayout.java:245)
> E/AndroidRuntime(18013):  at android.view.View.measure(View.java:8172)
> E/AndroidRuntime(18013):  at
> android.view.ViewRoot.performTraversals(ViewRoot.java:805)
> E/AndroidRuntime(18013):  at
> android.view.ViewRoot.handleMessage(ViewRoot.java:1744)
> E/AndroidRuntime(18013):  at
> android.os.Handler.dispatchMessage(Handler.java:99)
> E/AndroidRuntime(18013):  at android.os.Looper.loop(Looper.java:144)
> E/AndroidRuntime(18013):  at
> android.app.ActivityThread.main(ActivityThread.java:4937)
> E/AndroidRuntime(18013):  at
> java.lang.reflect.Method.invokeNative(Native Method)
> E/AndroidRuntime(18013):  at
> java.lang.reflect.Method.invoke(Method.java:521)
> E/AndroidRuntime(18013):  at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
> E/AndroidRuntime(18013):  at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
> E/AndroidRuntime(18013):  at dalvik.system.NativeStart.main(Native
> Method)
  • 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-24T22:37:35+00:00Added an answer on May 24, 2026 at 10:37 pm

    Like CommonsWare said in the comments above, only is supported by a ListPreference. Everything worked fine after I changed it to string-array.

    I am just putting it here since he/she did not put it as an answer.

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

Sidebar

Related Questions

I am trying to load a list of images from an array. I got
I have an array of URL Links that I'm trying to load into a
All, I am trying to load up a bmp file into a GLubyte array
I'm trying to load a list of regex patterns from a file, and I'd
I'm trying to load my ListView from the following array static final String[][] Bookings
I am trying to load a CSV file into an array using ColdFusion (version
I am am trying to use the LinkedList class to load an array of
I have a problem with out of memory when I'm trying load a few
Trying to load a shared lib out of the current '.' dir in a
While trying to load a Bitmap onto a SWFLoader the Event.COMPLETE event is not

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.