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

The Archive Base Latest Questions

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

Hi I have a list and I am redrawing the image based on the

  • 0

Hi I have a list and I am redrawing the image based on the setting on notification. Basically I can’t figure out why the image is NOT redrawn. I see in the log that it gets set.

Odly I tried to set a textview in the same view and that works fine. What’s wrong with the image? can anybody tell me?

Thank you in advance!

   @Override
        public View getView(int position, View convertView, ViewGroup parent)
        {

    //---- if the view is null, create a new one from xml
            if (convertView == null)
            {
                LayoutInflater layoutInflater = _context.getLayoutInflater();
                convertView = layoutInflater.inflate(R.drawable.my_item_layout, parent, false);
                convertView.setBackgroundResource(R.drawable.mybg);
            }

    CustomItem item = super.getItem(position);

    if (item != null)
    {
    TextView title = (TextView)convertView.findViewById(R.id.titleTextView);
    ImageView image1= (ImageView)convertView.findViewById(R.id.image1);


    title.setText(item.getName());


    if (item.getMyNotificationChangedItemState()){
         image1.setImageResource(R.drawable.myimagePink); <- this does not get updated 
        title.setTextColor(this._context.getResources().getColor(R.color.main_text_pink));   

 else 
       {
            image1.setImageResource(R.drawable.myimageBlue);
title.setTextColor(this._context.getResources().getColor(R.color.main_text_blue));  

       }
    }

So my Blue image & text gets shown when the list gets loaded the first time. Once notification happens I first update to change the one that’s currrently PINK to BLUE and then change the one that I need to update from BLUE to PINK depending on previous and current index of the items in the list. The update is done on the activity. I can see the log prints the fact that getMyNotificationChangedItemState() is changed, and the image is being set, but I never see the change in the UI.

Why does that work for TEXTVIEW and does not work for IMAGEVIEW?

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

    For adapters, getView() only gets called when the current view is invalidated.

    Have you made sure to call invalidate() on the view in question after you make the notification?

    As another sanity check, what about switching pink and blue and trying again?

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

Sidebar

Related Questions

I have list of words. I type in a word misspelled. Can I query
I have list of text that contain double quoate and upderscore. How can I
Code can be found here: http://www.myhorizon.ca/client_central/sortable_test.php Hello folks of Stackoverflow, I have a list
I have list of input area in the form with id like contact1_title, contact2_title,
I have list of articles on the page in table and i want to
I have list of structure. I want to modify a particular data from the
I have list of textareas. For textareas I use tinyMCE Editor. When I start
I have List I want to sort Desc by Priority, which is int and
i have list of rows that user select and i want to delete them,
i have list of images and on mouse over there is option box shows

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.