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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:26:02+00:00 2026-06-06T00:26:02+00:00

The documentation for the method getItemPosition in Android’s PagerAdapter class states that it is:

  • 0

The documentation for the method getItemPosition in Android’s PagerAdapter class states that it is:

Called when the host view is attempting to determine if an item’s position has changed.

This method is supposed to be called to indicate whether or not an item’s position in the group of items for that adapter has changed.

However, it never states when an overriding method should consider the position to be changed. Does it mean the position is different to the position it was in last time the item getItemPosition was called? Does it mean the item’s position is different to last time notifyDataSetChanged was called? Or does it mean that the item’s position is different to when the item was added to the viewPager?

  • 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-06T00:26:03+00:00Added an answer on June 6, 2026 at 12:26 am

    You can see in ViewPager.java that getItemPosition is called only in dataSetChanged. This means the item’s position changed if it’s different than the last time dataSetChanged was called.

    I would not worry so much about the meaning of “changed”; there are two cases:

    1. The position of the added items never changes, then getItemPosition returns POSITION_UNCHANGED;
    2. The position of the items changes, or items are removed. If the item position did not change, there is no difference if you return POSITION_UNCHANGED or the actual position. So to keep the implementation simple you can return the position (or POSITION_NONE) and forget about POSITION_UNCHANGED..
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use PDO's lastInsertId method, but the documentation states that for
The documentation says This method is called after the view controller has loaded its
Is it possible to set mouse-over view of method/class documentation in PHPStorm 3.0? So
A method that overrides another method does not inherit documentation of the method it
The jQuery documentation for the .toggle() method states: The .toggle() method is provided for
As stated in the documentation for the IDirectDraw7::SetCooperativeLevel method , it states You must
According to Android documentation, using the .getTime() method in the Android location will return
The MSDN Documentation: MemberInfo.GetCustomAttibutes Method (Type, Boolean) states in the remarks: This method ignores
I see the documentation says this method returns the position of the given item,
According to the documentation: When this method is first called, it creates a single

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.