The problem with typing in a separate version of ViewPager is 5.1.1 android?

I am creating an Android application where I use Custom ViewPager. The problem is explained below in the following steps:

  • When I open a new ViewPager activity and click on any button, and setText is some specific value. It works great.
  • The problem arises when I scroll left-right and then press a button to setText in a specific TextView; the value is set because I can toast the value of the TextView with getText. But the value does not change in the user interface. For exmaple - I scroll through any page, and now the TextView contains my current position as 2. If I press a button and try to setText (position ++) and toast to the value, the increased value is displayed in the toast
  • But still TextView shows 2.

This problem is especially relevant in 5.1.1.

+4
source share
1 answer

I also fought this several times. Best of all, I can determine that the ViewPager is really designed for one view, where nothing changes after the first appearance (which hides the error when SetView stops working). Think about it by showing fixed pages in a book.

( CursorAdapter) , , notifyDataSetChanged() , . , setText . , . .

0

All Articles