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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:30:14+00:00 2026-05-20T10:30:14+00:00

The settings of the Android Browser allow to click on a ListPreference if one

  • 0

The settings of the Android Browser allow to click on a ListPreference if one wants to clear the cache. If the users clicks on that ListPreference no list is shown – a dialog pops up instead.

I would like to use a similar feature to stop a running service.

I created an entry in the application settings without the android:entries and android:entryValues tags:

 <ListPreference
     android:key="list_stop"
     android:title="@string/txt_stopservice" />

No I try to catch the click:

 listPreferenceServiceStop = (ListPreference) preferenceScreen.findPreference("list_stop");
 listPreferenceServiceStop.setOnPreferenceClickListener(new OnPreferenceClickListener() {

    public boolean onPreferenceClick(Preference preference) {
        Tools.showToast(context, "BlaBla");
        return true;
    }

 });

If the user clicks on this entry the following error appears:

java.lang.IllegalStateException: ListPreference requires an entries array and an entryValues array.

The Android Browser settings don’t show values neither.

How do they do that? And is this the correct way to catch the click?

Many thanks in advance.
HJW

  • 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-20T10:30:14+00:00Added an answer on May 20, 2026 at 10:30 am

    Why are you using a ListPreference? You should use a DialogPreference instead.

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

Sidebar

Related Questions

my emulator browser not connecting to internet? how to do the settings? <application android:icon=@drawable/icon
Trying to develop an android app that integrates social networking, and the first one
I want to modify something in Settings.secure database, just as the android Settings app
How should change the date/time settings of the Android mobile phone through Android programming.
How do I make the settings navigation for SwitchReference like Android native settings app?
I'm attempting to change the screen brightness from withing a service, like so: android.provider.Settings.System.putInt(getContentResolver(),
On many Android devices you can get into a secret settings menu from Phone
I want to create settings page for my android application.In the settings page is
I want source code for inbuilt battery app of android, found in settings. I
I'm using a TextView element with following layout settings <TextView android:layout_width=fill_parent android:layout_height=wrap_content android:maxLines=1 android:lines=1

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.