Obsolete
Status Update
Comments
da...@gmail.com <da...@gmail.com> #2
Information redacted by Android Beta Feedback.
ma...@gmail.com <ma...@gmail.com> #3
Why hasn't this more stars? I have this in Beta right now and it's so annoying!
ma...@gmail.com <ma...@gmail.com> #4
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
nk...@gmail.com <nk...@gmail.com> #5
The issue is not reproducible on our internal development build (which is ahead of the public release). Please test it on the final public release and let us know if you are still having issues.
sa...@gmail.com <sa...@gmail.com> #7
I cannot reproduce anymore on S2B2.211203.006
ba...@gmail.com <ba...@gmail.com> #9
hi every one ,i upload a patch to fix this problem, but no guy add review or verifier it , you can add your feedbacks to help us to fix it forever.
related link:
https://android-review.googlesource.com/#/c/68333/
related link:
en...@google.com <en...@google.com>
[Deleted User] <[Deleted User]> #10
Issue is not obsolete .
please use Bangbang patch for viewpager of support package
please use Bangbang patch for viewpager of support package
[Deleted User] <[Deleted User]> #11
Is this fixed with the viewPager2??
ta...@gmail.com <ta...@gmail.com> #12
Just let the bug die, they won't fix it. It's hardly relevant 9 years after anyway.
Description
Use case: I have an activity that has a five page ViewPager.
In the onResume() method of that activity, I check for an intent parameter specifying which page to display and call pager.setCurrentItem(n, false) to select that page.
The ViewPager also has an OnPageChangeListener to watch for page changes and will tweak the page content (it highlights a field on the page).
The trouble is, if we have just created the ViewPager, and if the page selected is page 0, the OnPageChangeListener won't be called. Obviously this is because the ViewPager defaults to page 0 and doesn't think the page has changed.
IMO the listener ought to be called immediately after creation (with page set to 0).
At the moment, the work around is that I have to check which page is currently displayed and call the listener myself if necessary.
public class FooActivity extends Activity
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.view_pager);
ViewPager pager = (ViewPager) findViewById(R.id.view_pager);
pager.setAdapter(new FooPagerAdapter(this));
pager.setOnPageChangeListener(new OnPageChangeListener() {
@Override
public void onPageSelected(int position)
{
/**/Log.d("foo", "**** onPageSelected = "+position);
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {}
@Override
public void onPageScrollStateChanged(int arg0) {}
});
}
@Override
protected void onResume()
{
super.onResume();
int page = getIntent().getIntExtra("page", 0))
ViewPager pager = (ViewPager) findViewById(R.id.view_pager);
pager.setCurrentItem(page, false);
}
}
Android: 4.03