jeudi 5 novembre 2015

What is the best way to call notifyXXX methods inside the RecyclerView.Adapter subclass when I am loading data from SQLite?

I have searched far and wide on stackoverflow like HERE and HERE Before you point me to THIS solution or THIS solution, I want to insert item into the database from say a dialog and call notifyItemInserted, I would like to Swipe to Delete with the ItemTouchHelper.Callback and call the appropriate notifyItemRemoved method, I would like to actually delete multiple items at random positions as well and call either notifyItemChanged for each of those positions or notifyItemRangeChanged in bulk, both the solutions that most people have pointed out call notifyDataSetChanged, what is the best way for me to call nofifyXXX methods on my RecyclerView.Adapter implementation and keep SQLite as the data source for my Adapter?

Aucun commentaire:

Enregistrer un commentaire