I am new to Android. I need to get a list of strings from a JSON list. It will be added to a Spinner
list. I have the list on server like
[{\"bgrou
This is sample code :
GroupService groupService = createService(GroupService.class);
Call> groupCall = groupService.getGroups();
groupCall.enqueue(new Callback>() {
@Override
public void onResponse(retrofit.Response> response, Retrofit retrofit) {
}
@Override
public void onFailure(Throwable t) {
t.printStackTrace();
}
});
Interfaces :
public interface GroupService {
@GET("")
Call> getGroups();
}
Also create model name Groups.
I hope this helps you.