-
Notifications
You must be signed in to change notification settings - Fork 8
Get Objects
Hendra Permana edited this page May 6, 2017
·
1 revision
.getObjects(object)
try {
Profile[] profiles = (Profile[]) gsonSharedPreferences.getObjects(new Profile());
Log.i(TAG, profiles[1].getUserName());
} catch (ParsingException e) {
e.printStackTrace();
}
.getJsonArray(object)
try {
JSONArray array = gsonSharedPreferences.getJsonArray(new Profile());
} catch (ParsingException e) {
e.printStackTrace();
}
.getJsonArrayString(object)
try {
Log.i(TAG, gsonSharedPreferences.getJsonArrayString(new Profile()));
} catch (ParsingException e) {
e.printStackTrace();
}