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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:46:54+00:00 2026-06-17T14:46:54+00:00

Friends I have created a listpreferences screen ,and it is working fine but I

  • 0

Friends I have created a listpreferences screen ,and it is working fine but I want to change the color of text appearing on the list and the RadioGroup items. So can anyone help me out.

 <?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
        <ListPreference      
         android:entries="@array/gametype"
         android:entryValues="@array/gametype"
         android:key="listpref"
         android:summary=""
         android:title="Set Game Level" />
</PreferenceScreen>

This is my preferences screen.
After Clicking on listpreferences item it show a dialog box which has three options
so i want to change the color of that radiobutton text and the list item text.

here is java code:

        @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.prefs);
        SharedPreferences sp=getPreferenceScreen().getSharedPreferences();
        Preference pref=findPreference("listpref");
        ListPreference lp=(ListPreference)pref;
        pref.setSummary(lp.getValue());
        sp.registerOnSharedPreferenceChangeListener(this);


    }

    @Override
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
            String key) {
        Preference pref=findPreference(key);
        ListPreference lp=(ListPreference)pref;
        pref.setSummary(lp.getValue());
    }
  • 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-17T14:46:56+00:00Added an answer on June 17, 2026 at 2:46 pm
    public void setcolor(int position){
    for(int i=0;i<4;i++)
    {
        if(i==position)
        {
            list.getChildAt(i).setBackgroundColor(Color.rgb(238, 180,    180));
        }
        else{
            list.getChildAt(i).setBackgroundColor(Color.WHITE);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an invite friends code, which is properly working if an FB
Hi friends I have created newsletter system. In which I want to send person
I have created a list of my friends' names. By clicking on their names
friends, i want to delete file data that i have created in android application.
Hai Friends, I have created an sample application, in which i have a list
friends, i have created custom title bar using following titlebar.xml file with code <?xml
Hi stackoverflow friends, I have an instance that ,In symfony2 I created a security
Hello friends I have tried many times but I am not successful than please
I have a working WAMP environment (Apache Friends). I decided to try Subversion and
I have created an app, and now i want to post a message on

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.