How To Catch Java.lang.runtimeexception: Could Not Deserialize Object From Firebase Classmapper And Add Default Values
I am using Firebase UI Recycler Adapter to read data from Firestore FirestoreRecyclerOptions options = new FirestoreRecyclerOptions.Builder
Solution 1:
I'm answering this question becase of your request from here. So because I see that you are using the Firebase-UI library, there is no need to use a try-catch block. As also @FrankvanPuffelen mentioned in his comment, the simplest thing that you can do, is to override the onError
method in your adapter class like this:
FirestoreRecyclerAdapter adapter = new FirestoreRecyclerAdapter<Chat, ChatHolder>(options) {
@Override
public void onDataChanged() {
//Called each time there is a new query snapshot.
}
@Override
public void onError(FirebaseFirestoreException e) {
//Handle the error
Log.d(TAG, e.getMessage());
}
};
Post a Comment for "How To Catch Java.lang.runtimeexception: Could Not Deserialize Object From Firebase Classmapper And Add Default Values"