需要从mysql显示数据到android中的Listview。
ApiService api = ApiClient.getClient().create(ApiService.class);
Call <Subject> call = api.Getsubject();
call.enqueue(new Callback<Subject>() {
@Override
public void onResponse(Call<Subject>call, Response<Subject> response) {
if (response.isSuccessful())
{
list =(List<Subject>)response.body();
subjectlist.setAdapter(new
subjectAdapter(getApplicationContext(), list));
}
}