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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:09:28+00:00 2026-05-24T02:09:28+00:00

I have a preferenceActivity in my application and I have tried to set the

  • 0

I have a preferenceActivity in my application and I have tried to set the preference style using the following theme:

<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="MyPreferenceTheme" parent="android:Theme.Translucent">
    <item name="android:preferenceStyle">@style/MyPreference</item>
    <item name="android:windowBackground">@color/transparent_black</item>
</style>

<style name="MyPreference" parent="@android:style/Preference">
    <item name="android:layout">@layout/preference</item>
</style>

<color name="transparent_black">#BB000000</color>

So I know that the theme is loading as the background is colored correctly. However my custom preferenceLayout (res/layout/preference.xml) is not getting applied to any of the preferences inside my preferenceActivity.

Is this the correct way to achieve theming of the preferences? or have I missed something?
Thanks in advance 🙂

  • 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-24T02:09:29+00:00Added an answer on May 24, 2026 at 2:09 am

    I found that it’s best not to use parent=”android:style/Preference” as it doesn’t seem to apply the style I’m trying to override it with. Style your layout that you’re using (@layout/preference) and drop the inheritance from the android:style/Preference. It worked for me when I had to do the same.

    so it should be:

    <style name="MyPreference">
        <item name="android:layout">@layout/preference</item>
    </style>
    

    Good luck!

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

Sidebar

Related Questions

I have PreferenceActivity with some sample content: <?xml version=1.0 encoding=utf-8?> <PreferenceScreen xmlns:android=http://schemas.android.com/apk/res/android> <PreferenceCategory android:title=First
I have used PreferenceActivity to have preference in my android application. I want one
I have the following code in my application in res/xml/preferences.xml: <PreferenceScreen xmlns:android=http://schemas.android.com/apk/res/android> <PreferenceCategory android:title=Wi-Fi
I have 1 PreferenceActivity in preferences.xml is <CheckBoxPreference android:id=@+id/pushCB android:checked=true android:defaultValue=true android:key=PushService android:summary=Set to
I have a couple of CheckBoxPreferences set up, my preference class extends PreferenceActivity and
In my extended PreferenceActivity class I call addPreferencesFromResource(R.xml.livewallpaper_settings) so I have a xml file
I have an application that uses the new features of honeycomb for the PreferenceActivity.
I have several ListActivties set up in my Android Application. What I am trying
I am using a PreferenceActivity to let the user set some values. I am
I have a PreferenceActivity that loads two Fragments via the xml file for the

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.