简体   繁体   English

Android Jelly Bean不支持PullToRefreshListView

[英]PullToRefreshListView not supported in Android Jelly Bean

I had implemented the PullToRefreshListView from johan in an app which works great on every other version of Android except the new Jelly Bean. 我已经在一个应用程序中实现了johan的PullToRefreshListView,该应用程序在除新的Jelly Bean之外的所有其他版本的Android上都可以正常运行。 Does anyone know what might be the reason for this or if there exists a solution to this problem? 有谁知道这可能是什么原因,或者是否存在解决此问题的方法? I have tested this on the android version 4.1.1 with Samsung Galaxy S3. 我已经在三星银河S3的Android版本4.1.1上对此进行了测试。

Also, is it possible to set a filter within the app so that it can recognize if the device is running android version > 4.0. 另外,是否可以在应用程序内设置过滤器,以便它可以识别设备是否正在运行Android版本> 4.0。 This might be a temporary solution. 这可能是一个临时解决方案。

Thanks Rajat 谢谢拉贾特

Turns out this is an actual problem in Jelly Bean. 原来这是果冻豆中的实际问题。 The solution is in the author's page: 解决方案在作者页面中:

You need to change the following lines in the PullToRefreshListView class: 您需要在PullToRefreshListView类中更改以下几行:

@Override
protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    setSelection(1);
}

More here 这里更多

All the best 祝一切顺利

您要求的临时解决方案在此博客文章中进行了详细介绍,称为“延迟加载”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM