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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:23:33+00:00 2026-06-04T15:23:33+00:00

I am working on a app that shows some places in a listview. In

  • 0

I am working on a app that shows some places in a listview. In every listview item there is a arrow pointing towards the place(hotel, bar etc).

The problem is I don’t know how to keep this arrow updated efficiently, without cashing views locally( which, according to a Google I/O video, is something i should never ever do).

The arrow needs to be updated on every phone orientation sensor event, which is many times a second.

So is there a better approach than calling notifyDataSetChanged() on every event and refiling every list item data?

UPDATE (for @dharan and anyone interested):

I have stopped working on this project because I have a full-time job now, but I thought of a solution (unimplemented/untested).

First limit the angle of rotation to a fixed step, (eg: 5, 10, 15, 20, … 355, 360) then cache the rotated image for each angle of rotation in order to avoid expensive image rotation calculations (but at a higher memory cost).

After that I would make my getView() method know when to only update the image instead of all the data. In my case this is as easy as:

public View getView(int position, View convertView, ViewGroup parent) {
     if (convertView != null && place[position].id == (Integer)convertView.getTag()){
         //the place information is already set correctly so just update the image
     }
     ...
}

After these modifications I believe that calling notifyDataSetChanged() should not cause serious performance issues.

  • 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-04T15:23:35+00:00Added an answer on June 4, 2026 at 3:23 pm

    If you don’t have too many items in the ListView you could convert to using a plain LinearLayout and control those items individually. The problem with LinearLayout though is if an item changes its size then everything (ie all children) has to be relayed out. So triggering a change in one item can re-trigger other things to layout as well. Now because you’re changing a compass needle you might be able to skirt around it because that shouldn’t cause each row to change its overall size. You just need to repaint that item.

    The other option is to write your own layout that takes some short cuts making some assumptions the general purpose layout managers can’t. The last thing I might look at is what does notifyDataSetChanged() does under the covers. You might be able to extend ListView and write a method that only redraws the row that changed (of course this assumes the height of the row hasn’t changed). If the row height changes then everything after that row has to be relayed out.

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

Sidebar

Related Questions

Im implementing an app that shows some Twitter data, when is working on wifi
I'm working on an app that does some web scraping. In the sites model,
I'm working on a leaderboard in my facebook app that shows how many times
I'm working on an SEO app that (among other things) shows the number of
I'm working on a web app that allows a user to select some text,
On an app that I'm working on, I need a context menu to show
Im working on an app that now has to go to a URL online
I'm working on an app that works out debts and who owes what to
I'm working on an app that creates an user profile. I need to be
I am working on an app that takes a picture and saves it to

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.