gson.fromJson return null values
Since you are setting excludeFieldsWithoutExposeAnnotation()
configuration on the GsonBuilder
you must put @Expose
annotation on those fields you want to serialize/deserialize.
So in order for excludeFieldsWithoutExposeAnnotation()
to serialize/deserialize your fields you must add that annotation:
@Expose
private String userName;
@Expose
private String password;
Or, you could remove excludeFieldsWithoutExposeAnnotation()
from the GsonBuilder
.