Room showing null data. Trouble with complex data
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am new to the Android architecture components and have been trying out room for data storage from my server. Problem is no data is being shown on the recycler view and I think the issue is with inserting the data to the DB since I am able to retrieve data from my API using Retrofit and logging data from the DB shows null. Any suggestion's highly appreciated!
The Restaurant Pojo for the api:
RestaurantsModel.java
Restaurant Entity:
Restaurant.java
Location Entity(This is @Embedded in Restaurant entity):
Location.java
All of them are using a similar DataTypeConverters just of its type/class:
MenuTypeConverter.java
RestaurantDao.java:
@Dao
public interface RestaurantDao
@Insert(onConflict = OnConflictStrategy.REPLACE)
void saveAll(List<Restaurant> restaurants);
@Insert(onConflict = OnConflictStrategy.REPLACE)
void save(Restaurant restaurants);
@Update
void update(Restaurant restaurants);
@Delete
void delete(Restaurant restaurants);
@Query("SELECT * FROM Restaurant")
LiveData<List<Restaurant>> findAll();
@Query("SELECT COUNT(*) FROM Restaurant")
int totalRestaurants();
RestaurantsDatabase.java(I also tried adding to objects to the db which still didnt show up):
@Database(entities = Restaurant.class, version = 1)
public abstract class RestaurantsDatabase extends RoomDatabase
private static RestaurantsDatabase INSTANCE;
private final static List<Restaurant> RESTAURANTS = Arrays.asList(
new Restaurant("Winterlympics", "Norway's", "He finished","`1AM",
"6AM","d", "of", 2, 2, 4,
2, 2,4,4,null,"p",null,
new Location("USA", "USA", "USA", "USA", "USA", "USA", "USA", "USA"),
null,null,null,null,null),
new Restaurant("Winterlympics", "NOway's", "04850568540","`1AM",
"6AM","d", "of", 2, 2, 4,
2, 2,4,4,null,"p",null,
new Location("USA", "USA", "USA", "USA", "USA", "USA", "USA", "USA"),
null,null,null,null,null)
);
public abstract RestaurantDao restaurantDao();
private static final Object sLock = new Object();
public static RestaurantsDatabase getInstance(Context context)
synchronized (sLock)
if (INSTANCE == null)
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
RestaurantsDatabase.class, "Restaurants.db")
.allowMainThreadQueries()
.addCallback(new RoomDatabase.Callback()
@Override
public void onCreate(@NonNull SupportSQLiteDatabase db)
super.onCreate(db);
Executors.newSingleThreadExecutor().execute(
() -> getInstance(context).restaurantDao().saveAll(RESTAURANTS));
)
.build();
return INSTANCE;
RestaurantViewModel.java:
public class RestaurantViewModel extends AndroidViewModel
private RestaurantDao restaurantDao;
private ExecutorService executorService;
private ApiInterface webService;
public RestaurantViewModel(@NonNull Application application)
super(application);
restaurantDao = RestaurantsDatabase.getInstance(application).restaurantDao();
executorService = Executors.newSingleThreadExecutor();
webService = ApiClient.getApiClient().create(ApiInterface.class);
LiveData<List<Restaurant>> getAllRestaurants()
refreshUser();
Log.d("TAG", "============ From DB: " + restaurantDao.findAll().getValue());
return restaurantDao.findAll();
void saveRestaurant(Restaurant restaurant)
executorService.execute(() -> restaurantDao.save(restaurant));
void deleteRestaurant(Restaurant restaurant)
executorService.execute(() -> restaurantDao.delete(restaurant));
private void refreshUser()
executorService.execute(() ->
int numOfRestaurants = restaurantDao.totalRestaurants();
// If user have to be updated
if (numOfRestaurants < 30)
Call<RestaurantsModel> call = webService.getRestaurants("Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvb3Z0by5jb1wvYXBpXC9sb2dpbiIsImlhdCI6MTU0MjM2ODY4MiwiZXhwIjoxNTQyMzcyMjgyLCJuYmYiOjE1NDIzNjg2ODIsImp0aSI6Im1GSHM4WmNiUVN0TEdJRHMiLCJzdWIiOjEsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.-w1bouh4ljb-kk5zsu1vfaOcIIpaHcCUps5y3KuY6bc");
call.enqueue(new Callback<RestaurantsModel>()
@Override
public void onResponse(@NonNull Call<RestaurantsModel> call, @NonNull Response<RestaurantsModel> response)
restaurantDao.saveAll(response.body().getData().getData());
@Override
public void onFailure(@NonNull Call<RestaurantsModel> call, @NonNull Throwable t)
Log.d("TAG", "@Request onFailure " + t.toString());
);
);
MainActivity:
public class MainActivity extends AppCompatActivity
private RestaurantsAdapter restaurantsAdapter;
private RestaurantViewModel restaurantViewModel;
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
restaurantsAdapter = new RestaurantsAdapter(this);
restaurantViewModel = ViewModelProviders.of(this).get(RestaurantViewModel.class);
restaurantViewModel.getAllRestaurants().observe(this, restaurants -> restaurantsAdapter.setData(restaurants));
RecyclerView recyclerView = findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setHasFixedSize(true);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(restaurantsAdapter);
Adapter:
RestaurantsAdapter
Any further info needed do let me know. Thank you for even reading my long post...
java android android-room
add a comment |
I am new to the Android architecture components and have been trying out room for data storage from my server. Problem is no data is being shown on the recycler view and I think the issue is with inserting the data to the DB since I am able to retrieve data from my API using Retrofit and logging data from the DB shows null. Any suggestion's highly appreciated!
The Restaurant Pojo for the api:
RestaurantsModel.java
Restaurant Entity:
Restaurant.java
Location Entity(This is @Embedded in Restaurant entity):
Location.java
All of them are using a similar DataTypeConverters just of its type/class:
MenuTypeConverter.java
RestaurantDao.java:
@Dao
public interface RestaurantDao
@Insert(onConflict = OnConflictStrategy.REPLACE)
void saveAll(List<Restaurant> restaurants);
@Insert(onConflict = OnConflictStrategy.REPLACE)
void save(Restaurant restaurants);
@Update
void update(Restaurant restaurants);
@Delete
void delete(Restaurant restaurants);
@Query("SELECT * FROM Restaurant")
LiveData<List<Restaurant>> findAll();
@Query("SELECT COUNT(*) FROM Restaurant")
int totalRestaurants();
RestaurantsDatabase.java(I also tried adding to objects to the db which still didnt show up):
@Database(entities = Restaurant.class, version = 1)
public abstract class RestaurantsDatabase extends RoomDatabase
private static RestaurantsDatabase INSTANCE;
private final static List<Restaurant> RESTAURANTS = Arrays.asList(
new Restaurant("Winterlympics", "Norway's", "He finished","`1AM",
"6AM","d", "of", 2, 2, 4,
2, 2,4,4,null,"p",null,
new Location("USA", "USA", "USA", "USA", "USA", "USA", "USA", "USA"),
null,null,null,null,null),
new Restaurant("Winterlympics", "NOway's", "04850568540","`1AM",
"6AM","d", "of", 2, 2, 4,
2, 2,4,4,null,"p",null,
new Location("USA", "USA", "USA", "USA", "USA", "USA", "USA", "USA"),
null,null,null,null,null)
);
public abstract RestaurantDao restaurantDao();
private static final Object sLock = new Object();
public static RestaurantsDatabase getInstance(Context context)
synchronized (sLock)
if (INSTANCE == null)
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
RestaurantsDatabase.class, "Restaurants.db")
.allowMainThreadQueries()
.addCallback(new RoomDatabase.Callback()
@Override
public void onCreate(@NonNull SupportSQLiteDatabase db)
super.onCreate(db);
Executors.newSingleThreadExecutor().execute(
() -> getInstance(context).restaurantDao().saveAll(RESTAURANTS));
)
.build();
return INSTANCE;
RestaurantViewModel.java:
public class RestaurantViewModel extends AndroidViewModel
private RestaurantDao restaurantDao;
private ExecutorService executorService;
private ApiInterface webService;
public RestaurantViewModel(@NonNull Application application)
super(application);
restaurantDao = RestaurantsDatabase.getInstance(application).restaurantDao();
executorService = Executors.newSingleThreadExecutor();
webService = ApiClient.getApiClient().create(ApiInterface.class);
LiveData<List<Restaurant>> getAllRestaurants()
refreshUser();
Log.d("TAG", "============ From DB: " + restaurantDao.findAll().getValue());
return restaurantDao.findAll();
void saveRestaurant(Restaurant restaurant)
executorService.execute(() -> restaurantDao.save(restaurant));
void deleteRestaurant(Restaurant restaurant)
executorService.execute(() -> restaurantDao.delete(restaurant));
private void refreshUser()
executorService.execute(() ->
int numOfRestaurants = restaurantDao.totalRestaurants();
// If user have to be updated
if (numOfRestaurants < 30)
Call<RestaurantsModel> call = webService.getRestaurants("Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvb3Z0by5jb1wvYXBpXC9sb2dpbiIsImlhdCI6MTU0MjM2ODY4MiwiZXhwIjoxNTQyMzcyMjgyLCJuYmYiOjE1NDIzNjg2ODIsImp0aSI6Im1GSHM4WmNiUVN0TEdJRHMiLCJzdWIiOjEsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.-w1bouh4ljb-kk5zsu1vfaOcIIpaHcCUps5y3KuY6bc");
call.enqueue(new Callback<RestaurantsModel>()
@Override
public void onResponse(@NonNull Call<RestaurantsModel> call, @NonNull Response<RestaurantsModel> response)
restaurantDao.saveAll(response.body().getData().getData());
@Override
public void onFailure(@NonNull Call<RestaurantsModel> call, @NonNull Throwable t)
Log.d("TAG", "@Request onFailure " + t.toString());
);
);
MainActivity:
public class MainActivity extends AppCompatActivity
private RestaurantsAdapter restaurantsAdapter;
private RestaurantViewModel restaurantViewModel;
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
restaurantsAdapter = new RestaurantsAdapter(this);
restaurantViewModel = ViewModelProviders.of(this).get(RestaurantViewModel.class);
restaurantViewModel.getAllRestaurants().observe(this, restaurants -> restaurantsAdapter.setData(restaurants));
RecyclerView recyclerView = findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setHasFixedSize(true);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(restaurantsAdapter);
Adapter:
RestaurantsAdapter
Any further info needed do let me know. Thank you for even reading my long post...
java android android-room
Can you share your RestaurantsAdapter class and what do you exactly mean by "I think the issue is with inserting the data to the DB"?
– Red M
Nov 17 '18 at 0:00
add a comment |
I am new to the Android architecture components and have been trying out room for data storage from my server. Problem is no data is being shown on the recycler view and I think the issue is with inserting the data to the DB since I am able to retrieve data from my API using Retrofit and logging data from the DB shows null. Any suggestion's highly appreciated!
The Restaurant Pojo for the api:
RestaurantsModel.java
Restaurant Entity:
Restaurant.java
Location Entity(This is @Embedded in Restaurant entity):
Location.java
All of them are using a similar DataTypeConverters just of its type/class:
MenuTypeConverter.java
RestaurantDao.java:
@Dao
public interface RestaurantDao
@Insert(onConflict = OnConflictStrategy.REPLACE)
void saveAll(List<Restaurant> restaurants);
@Insert(onConflict = OnConflictStrategy.REPLACE)
void save(Restaurant restaurants);
@Update
void update(Restaurant restaurants);
@Delete
void delete(Restaurant restaurants);
@Query("SELECT * FROM Restaurant")
LiveData<List<Restaurant>> findAll();
@Query("SELECT COUNT(*) FROM Restaurant")
int totalRestaurants();
RestaurantsDatabase.java(I also tried adding to objects to the db which still didnt show up):
@Database(entities = Restaurant.class, version = 1)
public abstract class RestaurantsDatabase extends RoomDatabase
private static RestaurantsDatabase INSTANCE;
private final static List<Restaurant> RESTAURANTS = Arrays.asList(
new Restaurant("Winterlympics", "Norway's", "He finished","`1AM",
"6AM","d", "of", 2, 2, 4,
2, 2,4,4,null,"p",null,
new Location("USA", "USA", "USA", "USA", "USA", "USA", "USA", "USA"),
null,null,null,null,null),
new Restaurant("Winterlympics", "NOway's", "04850568540","`1AM",
"6AM","d", "of", 2, 2, 4,
2, 2,4,4,null,"p",null,
new Location("USA", "USA", "USA", "USA", "USA", "USA", "USA", "USA"),
null,null,null,null,null)
);
public abstract RestaurantDao restaurantDao();
private static final Object sLock = new Object();
public static RestaurantsDatabase getInstance(Context context)
synchronized (sLock)
if (INSTANCE == null)
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
RestaurantsDatabase.class, "Restaurants.db")
.allowMainThreadQueries()
.addCallback(new RoomDatabase.Callback()
@Override
public void onCreate(@NonNull SupportSQLiteDatabase db)
super.onCreate(db);
Executors.newSingleThreadExecutor().execute(
() -> getInstance(context).restaurantDao().saveAll(RESTAURANTS));
)
.build();
return INSTANCE;
RestaurantViewModel.java:
public class RestaurantViewModel extends AndroidViewModel
private RestaurantDao restaurantDao;
private ExecutorService executorService;
private ApiInterface webService;
public RestaurantViewModel(@NonNull Application application)
super(application);
restaurantDao = RestaurantsDatabase.getInstance(application).restaurantDao();
executorService = Executors.newSingleThreadExecutor();
webService = ApiClient.getApiClient().create(ApiInterface.class);
LiveData<List<Restaurant>> getAllRestaurants()
refreshUser();
Log.d("TAG", "============ From DB: " + restaurantDao.findAll().getValue());
return restaurantDao.findAll();
void saveRestaurant(Restaurant restaurant)
executorService.execute(() -> restaurantDao.save(restaurant));
void deleteRestaurant(Restaurant restaurant)
executorService.execute(() -> restaurantDao.delete(restaurant));
private void refreshUser()
executorService.execute(() ->
int numOfRestaurants = restaurantDao.totalRestaurants();
// If user have to be updated
if (numOfRestaurants < 30)
Call<RestaurantsModel> call = webService.getRestaurants("Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvb3Z0by5jb1wvYXBpXC9sb2dpbiIsImlhdCI6MTU0MjM2ODY4MiwiZXhwIjoxNTQyMzcyMjgyLCJuYmYiOjE1NDIzNjg2ODIsImp0aSI6Im1GSHM4WmNiUVN0TEdJRHMiLCJzdWIiOjEsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.-w1bouh4ljb-kk5zsu1vfaOcIIpaHcCUps5y3KuY6bc");
call.enqueue(new Callback<RestaurantsModel>()
@Override
public void onResponse(@NonNull Call<RestaurantsModel> call, @NonNull Response<RestaurantsModel> response)
restaurantDao.saveAll(response.body().getData().getData());
@Override
public void onFailure(@NonNull Call<RestaurantsModel> call, @NonNull Throwable t)
Log.d("TAG", "@Request onFailure " + t.toString());
);
);
MainActivity:
public class MainActivity extends AppCompatActivity
private RestaurantsAdapter restaurantsAdapter;
private RestaurantViewModel restaurantViewModel;
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
restaurantsAdapter = new RestaurantsAdapter(this);
restaurantViewModel = ViewModelProviders.of(this).get(RestaurantViewModel.class);
restaurantViewModel.getAllRestaurants().observe(this, restaurants -> restaurantsAdapter.setData(restaurants));
RecyclerView recyclerView = findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setHasFixedSize(true);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(restaurantsAdapter);
Adapter:
RestaurantsAdapter
Any further info needed do let me know. Thank you for even reading my long post...
java android android-room
I am new to the Android architecture components and have been trying out room for data storage from my server. Problem is no data is being shown on the recycler view and I think the issue is with inserting the data to the DB since I am able to retrieve data from my API using Retrofit and logging data from the DB shows null. Any suggestion's highly appreciated!
The Restaurant Pojo for the api:
RestaurantsModel.java
Restaurant Entity:
Restaurant.java
Location Entity(This is @Embedded in Restaurant entity):
Location.java
All of them are using a similar DataTypeConverters just of its type/class:
MenuTypeConverter.java
RestaurantDao.java:
@Dao
public interface RestaurantDao
@Insert(onConflict = OnConflictStrategy.REPLACE)
void saveAll(List<Restaurant> restaurants);
@Insert(onConflict = OnConflictStrategy.REPLACE)
void save(Restaurant restaurants);
@Update
void update(Restaurant restaurants);
@Delete
void delete(Restaurant restaurants);
@Query("SELECT * FROM Restaurant")
LiveData<List<Restaurant>> findAll();
@Query("SELECT COUNT(*) FROM Restaurant")
int totalRestaurants();
RestaurantsDatabase.java(I also tried adding to objects to the db which still didnt show up):
@Database(entities = Restaurant.class, version = 1)
public abstract class RestaurantsDatabase extends RoomDatabase
private static RestaurantsDatabase INSTANCE;
private final static List<Restaurant> RESTAURANTS = Arrays.asList(
new Restaurant("Winterlympics", "Norway's", "He finished","`1AM",
"6AM","d", "of", 2, 2, 4,
2, 2,4,4,null,"p",null,
new Location("USA", "USA", "USA", "USA", "USA", "USA", "USA", "USA"),
null,null,null,null,null),
new Restaurant("Winterlympics", "NOway's", "04850568540","`1AM",
"6AM","d", "of", 2, 2, 4,
2, 2,4,4,null,"p",null,
new Location("USA", "USA", "USA", "USA", "USA", "USA", "USA", "USA"),
null,null,null,null,null)
);
public abstract RestaurantDao restaurantDao();
private static final Object sLock = new Object();
public static RestaurantsDatabase getInstance(Context context)
synchronized (sLock)
if (INSTANCE == null)
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
RestaurantsDatabase.class, "Restaurants.db")
.allowMainThreadQueries()
.addCallback(new RoomDatabase.Callback()
@Override
public void onCreate(@NonNull SupportSQLiteDatabase db)
super.onCreate(db);
Executors.newSingleThreadExecutor().execute(
() -> getInstance(context).restaurantDao().saveAll(RESTAURANTS));
)
.build();
return INSTANCE;
RestaurantViewModel.java:
public class RestaurantViewModel extends AndroidViewModel
private RestaurantDao restaurantDao;
private ExecutorService executorService;
private ApiInterface webService;
public RestaurantViewModel(@NonNull Application application)
super(application);
restaurantDao = RestaurantsDatabase.getInstance(application).restaurantDao();
executorService = Executors.newSingleThreadExecutor();
webService = ApiClient.getApiClient().create(ApiInterface.class);
LiveData<List<Restaurant>> getAllRestaurants()
refreshUser();
Log.d("TAG", "============ From DB: " + restaurantDao.findAll().getValue());
return restaurantDao.findAll();
void saveRestaurant(Restaurant restaurant)
executorService.execute(() -> restaurantDao.save(restaurant));
void deleteRestaurant(Restaurant restaurant)
executorService.execute(() -> restaurantDao.delete(restaurant));
private void refreshUser()
executorService.execute(() ->
int numOfRestaurants = restaurantDao.totalRestaurants();
// If user have to be updated
if (numOfRestaurants < 30)
Call<RestaurantsModel> call = webService.getRestaurants("Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczpcL1wvb3Z0by5jb1wvYXBpXC9sb2dpbiIsImlhdCI6MTU0MjM2ODY4MiwiZXhwIjoxNTQyMzcyMjgyLCJuYmYiOjE1NDIzNjg2ODIsImp0aSI6Im1GSHM4WmNiUVN0TEdJRHMiLCJzdWIiOjEsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.-w1bouh4ljb-kk5zsu1vfaOcIIpaHcCUps5y3KuY6bc");
call.enqueue(new Callback<RestaurantsModel>()
@Override
public void onResponse(@NonNull Call<RestaurantsModel> call, @NonNull Response<RestaurantsModel> response)
restaurantDao.saveAll(response.body().getData().getData());
@Override
public void onFailure(@NonNull Call<RestaurantsModel> call, @NonNull Throwable t)
Log.d("TAG", "@Request onFailure " + t.toString());
);
);
MainActivity:
public class MainActivity extends AppCompatActivity
private RestaurantsAdapter restaurantsAdapter;
private RestaurantViewModel restaurantViewModel;
@Override
protected void onCreate(Bundle savedInstanceState)
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
restaurantsAdapter = new RestaurantsAdapter(this);
restaurantViewModel = ViewModelProviders.of(this).get(RestaurantViewModel.class);
restaurantViewModel.getAllRestaurants().observe(this, restaurants -> restaurantsAdapter.setData(restaurants));
RecyclerView recyclerView = findViewById(R.id.recyclerView);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setHasFixedSize(true);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(restaurantsAdapter);
Adapter:
RestaurantsAdapter
Any further info needed do let me know. Thank you for even reading my long post...
java android android-room
java android android-room
edited Nov 17 '18 at 13:33
Inconnu
asked Nov 16 '18 at 13:38
InconnuInconnu
3,77322134
3,77322134
Can you share your RestaurantsAdapter class and what do you exactly mean by "I think the issue is with inserting the data to the DB"?
– Red M
Nov 17 '18 at 0:00
add a comment |
Can you share your RestaurantsAdapter class and what do you exactly mean by "I think the issue is with inserting the data to the DB"?
– Red M
Nov 17 '18 at 0:00
Can you share your RestaurantsAdapter class and what do you exactly mean by "I think the issue is with inserting the data to the DB"?
– Red M
Nov 17 '18 at 0:00
Can you share your RestaurantsAdapter class and what do you exactly mean by "I think the issue is with inserting the data to the DB"?
– Red M
Nov 17 '18 at 0:00
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53338987%2froom-showing-null-data-trouble-with-complex-data%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53338987%2froom-showing-null-data-trouble-with-complex-data%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you share your RestaurantsAdapter class and what do you exactly mean by "I think the issue is with inserting the data to the DB"?
– Red M
Nov 17 '18 at 0:00