private void requestLabel() {
this.callbackLabelCall = RestAdapter.createApiCategory(sharedPref.getBloggerId()).getLabel();
this.callbackLabelCall.enqueue(new Callback<CallbackLabel>() {
public void onResponse(@NonNull Call<CallbackLabel> call, @NonNull Response<CallbackLabel> response) {
CallbackLabel resp = response.body();
if (resp == null) {
// showAppOpenAdIfAvailable();
startMainActivity();
return;
}
dbLabel.truncateTableCategory(DbLabel.TABLE_LABEL);
dbLabel.addListCategory(resp.feed.category, DbLabel.TABLE_LABEL);
// showAppOpenAdIfAvailable();
startMainActivity();
Log.d(TAG, "Success initialize label with count " + resp.feed.category.size() + " items");
}
public void onFailure(@NonNull Call<CallbackLabel> call, @NonNull Throwable th) {
if (!call.isCanceled()) {
// showAppOpenAdIfAvailable();
startMainActivity();
}
}
});