我尝试了各种方法来阅读我最不成功的对象。 用Gson,babble只是java,
所有类都是Objetc的后代,为什么会发生错误。
public class InputDefault implements Serializable {
private static final long serialVersionUID = 6755668336349284303L;
private Object Result;
private boolean Success;
private String SuccessMessage;
public class InputGetInfosUser implements Serializable{
private static final long serialVersionUID = 7433623152728612356L;
@SerializedName("UserId")
private int id;
@SerializedName("UserName")
private String userName;
@SerializedName("Email")
private String email;
@SerializedName("Gender")
private String gender;
@SerializedName("LastLogin")
private String lastLogin;
@GET("/")
public void getInfosUser(
CancelableCallback<InputDefault> inPutCallSupportCancelableCallback
);
ERRO 1
public void sucessGetInfosUserOnListener(Object response) {
InputDefault inputDefault = ((InputDefault) response);
InputGetInfosUser inputGetInfosUser = null;
String result1 = inputDefault.getResult().toString().trim();
Gson gson = new Gson();
inputGetInfosUser = gson.fromJson(result1, InputGetInfosUser.class); //error
值result1
ERRO 2
public void sucessGetInfosUserOnListener(Object response) {
InputDefault inputDefault = ((InputDefault) response);
InputGetInfosUser inputGetInfosUser = ((InputGetInfosUser) inputDefault.getResult()); //erro