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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:33:50+00:00 2026-05-24T07:33:50+00:00

I’m writing a vertical scrollable calendar application(listview) that is always showing 1 month at

  • 0

I’m writing a vertical scrollable calendar application(listview) that is always showing 1 month at a time. Whenever the user scrolls a certain amount of dip either up or down the I want the calendar to jump either to the next or previous month(depending of the direction of the scroll).

I do the jump with the setSelection method. My problem is that for some reason setSelection calls getView twice. First it calls for position 0 then for position 1 – always.
So basically whenever I want to scroll to an adjacent month getView is called 3 times.
First it is called because the list needs to show the top/bottom of the next/previous month
and after that – as I said – it is called twice because of setSelection(for position 0 and position 1 always).

I have two problems with this. First I have a textview that keeps refreshing every time I scroll to a new month. I provide the data for this textview based on calculations I do in getView and since the getView is called 2 additional times with false datas(for position 0 and 1… in other words the very first and second month the calendar is capable showing) my date textviews shows wrong date sometimes.(to be more exact it shows the first month of the list whenever I scroll really fast instead of the actual month)

Of course I could solve this somehow e.g. I put a counter integer in the getView method or something like this but my other problem is that the calendar is a bit laggy. Instead of scrolling smoothly it needs about a second to load the next month whenever I start the scrolling motion.
If somehow I could avoid setSelection that’d solve both of my problems.
I’ve tried using scrollBy but it doesn’t generate the next month.

Any ideas?
Thanks in advance

  • 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-24T07:33:51+00:00Added an answer on May 24, 2026 at 7:33 am

    Rather than trying to reduce the number of getView calls you should reduce the amount of processing that is done within the getView method. This method should focus on assigning values rather than performing calculations. You should not try to pre-empt the calls.

    In this case you could easily hold a list of post-calculated data objects that your adapter can read off.

    If you are not already doing so, you should also take advantage of the view holder pattern demonstrated here.

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

Sidebar

Related Questions

No related questions found

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.