Skip to content Skip to sidebar Skip to footer

Retrieve The Data From The Realmdatabase And Set It To Gridview

I am able to Save the JSON Data to the Realm Database. I have used as the documentation of the Realm, but I am not able to set the data to the GridView. I am using Custom Adapter n

Solution 1:

Instead of

publicclassFavouriteAdapterextendsBaseAdapter {

    Context mContext;
    ArrayList<RealmDatabasePopularDestination> clas_realm_bookmark = null;

You should be using RealmBaseAdapter from realm-android-adapters as specified in the documentation.

Solution 2:

you are setting adapter to list view before extracting data from database.

RealmResults<RealmDatabasePopularDestination> result = realm.where(RealmDatabasePopularDestination.class).equalTo("Title","niyash temple").findAll();
result.load();

FavouriteAdapter favouriteAdapter = new FavouriteAdapter(getContext(), destination_bookmark_realm);
gridViewBookmark.setAdapter(favouriteAdapter);

use above code and.

destination_bookmark_realm it should be load with the result you got from databse

Post a Comment for "Retrieve The Data From The Realmdatabase And Set It To Gridview"