I have a JsonObjectRequest Get Method (volley), it was working fine, I got an JsonObject and used it for further actions but now it doesn't do what I want..
In the same class like the Get Request, I have the Method processResponse, which creates an "Account" Object and adds it to the Manager List:
private void processResponse(JSONObject response) {
try {
Log.e("processResponse", " called");
final Account user = new Account("","","");
String username = response.getString("Username");
String email = response.getString("Email");
String id = response.getString("Id");
user.setUsername(username);
user.setEmail(email);
user.setId(id);
Manager.AddObjectToUserList(user);
Manager Class with List:
class Manager {
private static List<Account> _ListofUsers = new ArrayList<Account>();
static void AddObjectToUserList(Account acc)
{
_ListofUsers.add(acc);
}
List<Account> getListOfUsers(){
return _ListofUsers;
}
}
I get an JsonObject from the GetResponse, it does successfully process the Response and creates an Object but when i want to return the List in Manager to another class, the "return List" is 0, I don't get the problem, since it was working fine before.
In debug mode, it jumps after the return List into the Looper.java and it doesn't leave this class..