211 RecyclerView Database Example |

Publicado em: 17 Março 2016
no canal de: slidenerd
38,896
181

Launch Your First Android app with our TOP course at 82% OFF (24 hrs ONLY) HERE https://goo.gl/7veBXc
This video shows how to display data from database inside RecyclerView. In our case, we need to display data from Realm database inside our RecyclerView with the help of the RecyclerView.Adapter. The onCreateViewHolder is called initially when a row needs to be displayed for a few times and then the onBindViewHolder is called for all subsequent iterations. Create an Application subclass and override the onCreate method to define a RealmConfiguration which we set as the default configuration. In the main activity, we simply get an instance of Realm using getDefaultInstance using which we can query all the drops stored in our database asynchronously. We use a RealmChangeListener to be notified when the drops have finished loading from the database and store the results inside a RealmResults object. Finally we call notifyDataSetChanged method to refresh the RecyclerView as we add more items to it.


Nesta página do site você pode assistir ao vídeo on-line 211 RecyclerView Database Example | duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário slidenerd 17 Março 2016, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 38,896 vezes e gostou 181 espectadores. Boa visualização!