In order to achieve better user experience in application development, listview needs to remember the last sliding position. Getscroll () always returns 0, because getscroll () is the view method.
Finally, I found this on Google:
// save index and top position
int index = mList.getFirstVisiblePosition();
View v = mList.getChildAt(0);
int top = (v == null) ?0 : v.getTop();
// ...
// restore
mList.setSelectionFromTop(index, top);
Read More:
- Error 1606 could not access network location% SystemDrive% / inetpub / wwwroot /
- Error 1606 Could Not Access Network Location %SystemDrive%/inetpub/wwwroot/
- Error: (21,13) Java: symbol not found: class order location: interface mapper.ordermapper
- 0xc0000005: an access conflict occurred while reading location 0x00000020
- Segmentation fault (SIGSEGV) location method
- Modify the default file location of the Jupiter notebook
- Location and optimization of server IO high problem
- Unhandled exception: 0xc0000005: access violation while reading location 0x00000000
- Opencv: 0xc0000005: an access conflict occurred while reading location 0x0000000010
- Record the location and cleaning of chrome junk files under appdata of Disk C
- [Solved] Android Gradle configure error: Location: Class buildconfig
- Oops error location method in ARM kernel
- Memory error unhandled exception: 0xc0000005: read location: 0x00000
- Gradle location is incorrect in IntelliJ
- VC + + COM programming error of 0xc0000005: access conflict when reading location 0xfeefef6
- Common forms of springboot2. X boot class location
- Three possibilities of “unhandled exception: 0xc0000005: access conflict when reading location 0x00000000”
- Windows encountered 1152 when installing software: error extracting files to the temporary location
- Bug resolution of 0xc0000005: access conflict occurred when reading location of 0x00000000.
- When installing oracle12c, the problem of “unable to check whether the specified location is on CFS” appears