Skip to content Skip to sidebar Skip to footer

Expected BEGIN_ARRAY But Was BEGIN_OBJECT | ArrayList Issue

I'm using the Gson library to save and retrieve an ArrayList of Players Objects. My onStop() @Override protected void onStop() { super.onStop(); SharedPreferences prefs =

Solution 1:

You probably write to the same preferences entry somewhere else. Ensure that your key (GUARD) is unique throughout the application.


Solution 2:

The problem is with your Response while Gson converting a response it expected Array in response but in your response you have made you are passing Object.

This is already answered here and here

here is reverse situation described.


Post a Comment for "Expected BEGIN_ARRAY But Was BEGIN_OBJECT | ArrayList Issue"