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

  • Home
  • SEARCH
  • 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 9122615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:08:41+00:00 2026-06-17T06:08:41+00:00

I have a requirement, to toggle the image of a listview item(s) from a

  • 0

I have a requirement, to toggle the image of a listview item(s) from a button located in the header section of the view.

So I have a listview that uses a custom BaseAdapter, the adapter is pretty basic, it has an ImageView and a TextView per item.

The header section will have 2 buttons, each button will have a package associated to it. For example.

Button A will have PACKAGE {A=Product 1, C=Product 3, G=Product 7}
Button B will have PACKAGE {B=Product 2, D=Product 4, G=Product 7}

The Listview Items will have the following items along with an image.

{A=Product 1, B=Product 2, 
C=Product 3, D=Product 4, 
E=Product 5, F=Product 6, G=Product 7}

Simulated Listview

image green - A Product 1 
image green - B Product 2
image green - C Product 3
image green - D Product 4
image green - E Product 5
image green - F Product 6 
image green - G Product 7

If the user select’s button “A” the images of the listview items should change from red to green
only for the items that are in button “A” package list. So for this example, only listview
items A, C and G will have their image items changed to GREEN.

How can I update the listview items without actually having the user having to click on the listview item?

  • 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-17T06:08:42+00:00Added an answer on June 17, 2026 at 6:08 am

    I suppose you have implemented the OnClickListener for your 2 buttons.

    Now when clicking on one the buttons you save what kind of button you clicked inside a global variable.

    After that call notifyDataChanged() on you Adapter.

    When notifyDataChanged() is called the getView(int position, View convertView, ViewGroup parent) of your Adapter is called.

    The getView method is called for every visible item in your ListView.
    Now inside the getView method you simply just switch the images on whether it’s button A that were clicked or button B that were clicked.

    For an example on how to customize your Adapter for the ListView have a look at this post: http://www.androidhive.info/2012/02/android-custom-listview-with-image-and-text/

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

Sidebar

Related Questions

In our project we have requirement that, after receiving sms message from third party
I have a requirement for a Toggle button in Android. I have been trying
I have small issue and that is I am now working with toggle button
I have requirement that if user click on a button then the li should
I have requirement like play store app where there is view pager with images
I have requirement where when a user enter new item in a list first
I am new in C# and have requirement to retrieve a url from C#.
In my app, I have requirement of showing calendar. Since, calendar view is available
I have requirement in which I continuously receive messages that needs to be written
I have requirement to create asp .net application that will upload garmin .fit files

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.