Remote ListView blinks on android widget

空扰寡人 提交于 2019-12-20 04:10:47

问题


I am having an unexpected bothering issue with a remote listview. My app has a simple widget which includes a listview. If the listview has 1 cell height and the listview is at the beginning of its scroll it blinks/flahses everytime datasetchanged is called. The funny thing is that if the listview has more than 1 cell height or if it has 1 cell height BUT it has been scrolled down a bit it doesnt blink. Could anybody please provide some suggestion? I am frustrated. Solutions I have thought so far: 1. Disable loading view (which is what is causing the flash) on the remoteViewFactory. However I dont know how to do this. Dont even know if it would work.

Thank you very much.


回答1:


Ok I found a solution to blinking problem while clicking the widget. For example if you look at youtube app in android, you might recognize it waits you until its open. In below, you may try to set android:windowDisablePreview to true in your style.xml. I believe Google used same method to prevent preview mode in Youtube app.

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="android:actionBarStyle">@style/Widget.AppCompat.ActionBar</item>
        <!-- closed the preview window -->
        <item name="android:windowDisablePreview">true</item>

    </style>

I hope this solution helps you.



来源:https://stackoverflow.com/questions/29260843/remote-listview-blinks-on-android-widget

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!