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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:42:37+00:00 2026-05-31T09:42:37+00:00

I have extended a cursor adapter public class MyAdapter extends CursorAdapter { MyAdapter(View view,

  • 0

I have extended a cursor adapter

public class MyAdapter extends CursorAdapter {

    MyAdapter(View view, Context context, Cursor cursor) {

         ...

    }

    public void bindView(View view, Context con, Cursor c) {

         if (OtherClass.currentlyPlaying.equals(ring)) {

             TextView.setTextColor(Color.red);
         }
    }



}

The ‘currentlyPlaying’ is a string in another class that corresponds with a title that is currently playing. The ‘ring’ is a title that is found when binding the view in the adapter. I have the textview change color when it’s selected. When it’s selected it changes colors, but when I click another item in the listview it changes color too, but the old item that was selected remains the same color.

Can anyone tell me if there is a way to update the view or how I would be able to apply maybe a viewholder to this? Thanks!

  • 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-31T09:42:38+00:00Added an answer on May 31, 2026 at 9:42 am

    try using the else{} part of your “if” and set it to the default color. Something like

    if (OtherClass.currentlyPlaying.equals(ring)) {
    
        TextView.setTextColor(Color.red);
    }else{
        TextView.setTextColor(Your default color);
    }
    

    From what I get is that the old item is not getting redrawn. ViewHolder could mostly help you too but for that you need to implement it. You could try the following tutorial in this thread.

    https://stackoverflow.com/a/9696185/1244489

    You might find it useful.

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

Sidebar

Related Questions

I have extended the Application class like this: public class MyApplication extends Application {
I have extended the android View class, and now I want to define a
I have extended a class like so: public class CormantRadDock : Telerik.Web.UI.RadDock { public
I am trying to draw an animation. To do so I have extended View
I have to open a page from class extended from javax.swing.AbstractAction class... Is that
I have extended my class with a dialog in which I have set content
I have extended an mxml component with an actionscript class. I'm trying to access
I have extended the ActiveRecord::Base class as follows: lib/activerecord_ext.rb: class ActiveRecord::Base named_scope( :recent, :conditions
I have extended the ImageView class in a class called DialButton2 (dont worry about
I have extended an Entity Framework 4 entity class with a calculated property in

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.