数据库数据变化时如何保持ListView的滚动位置

how to maintain scroll position of ListView when database data change

我正在制作包含纯文本和图像消息的聊天视图。我正在使用 ListView 和 costumised CursorAdapter。我的问题是当数据库中发生任何变化时,例如看到更新、已发送或已交付状态 ListView 只是将位置滚动到 bottom.how 保持位置 same.Thanks

我通过从 ListView 属性中删除以下行来解决问题
android: transcriptMode="alwaysScroll"