211 RecyclerView Database Example |

Publicado el: 17 marzo 2016
en el 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.


En esta página del sitio puede ver el video en línea 211 RecyclerView Database Example | de Duración hora minuto segunda en buena calidad , que subió el usuario slidenerd 17 marzo 2016, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 38,896 veces y le gustó 181 a los espectadores. Disfruta viendo!