Android: Handling very large data sets in ContentProvider to avoid memory limits

前端 未结 2 2028
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-03 13:41

I am using a ContentProvider to query a database and return a Cursor that is used in a CursorLoader:

ItemsActivity:

         


        
2条回答
  •  [愿得一人]
    2021-01-03 13:59

    Mobile devices are not designed to handle these amounts of data.

    However, if you really want to inflict such a large scrolling list on your poor users, you can design it as a virtual list where entries are loaded only on demand; see Android Endless List.

    Note: Using the OFFSET clause is inefficient; see Scrolling Cursor for details.

提交回复
热议问题