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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:29:36+00:00 2026-05-30T04:29:36+00:00

I have a Gallery, which has an adapter connects to it. In the getView

  • 0

I have a Gallery, which has an adapter connects to it. In the getView method, i have a custom layout, so that I can i have image and caption displayed together

The image is downloaded from an URL, which is done asynchously, and working as expected.

Currently i make each item to fill the screen, so i only have one item display at a time, basically i want to make it like a slide show.

let me be clear, currently i have an activity, and it only has one View, which is a Gallery.

problem occurs when I am swiping, the image bounces and stays at the same image. i need to swipe many times, hard, and long swipe, then i can get to next image.

i put a debug message in my custom adapter in the getView(), it seems getView is getting called many times (4 times), and position being passed is either the current position or the previous one, which explains why i am stuck at the same screen.

if i remove the remote downloading image part, or just use a static image form the phone, i don’t have any more issues, in fact, the getView only gets called once, with correct position.

i am very frustrated, not sure what the problem is, could it be because i am downloading image asynchously, which will cause the image to update which causes getView to get called again to redraw itself?
i am not sure..

please help

  • 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-30T04:29:38+00:00Added an answer on May 30, 2026 at 4:29 am

    Unfortunately this is a bug with gallery. Listviews will scroll nicely regardless of data being updated asynchronously. However, the gallery is just not coded up to par with the listview

    When the gallery tries to update a visible view (due to your image loading callback) this view will “snap” back to the focused position. If you are changing the view in any way when it is scrolling it will snap. This is likely why you have to scroll hard to get away from the current view. It is trying to perform a callback on your view and only scrolling fast will prevent the callback from occurring before you move away from that view.

    I’ve reported this bug a while ago here:
    Android Issues
    There are a few workarounds posted in there you can try if you are set on using a Gallery.

    Unfortunately it hasn’t gained attention from the Android developers.
    It seems the issue is caused with views being set to “wrap_content” and the gallery having to remeasure/redraw its views

    I have since migrated away from using the gallery and instead use a ViewPager. It is much easier to manage and you don’t have to worry about this problem. This has been a known problem with the Gallery since the gallery was first introduced. I have no idea if this was fixed in any of the newer Android versions (3.x/4.x). As of 2.3.7 it is not fixed.

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

Sidebar

Related Questions

what i want to do is that i have a nice image Gallery which
I have a Gallery, which has an OnItemSelectedListener and an OnItemClickListener. So I can
I've got an activity which has a gallery that is backed by an Adapter
I have got a PHP image gallery, which has about 20000 photo files. I
I have the video gallery in my database, which has over 200 000 videos.
Hi I have a gallery in my app which shows the image in an
I have created a class which extends Gallery. There is no onCreate() method in
I have created a XML image gallery, which displays text in between each slide.
I have a gallery which has 7 + linear layouts in each view, and
Basicly I have a photo gallery which has graphic above the photos with text

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.