java.lang.ClassCastException:com.stars.learnyourhome.DataModel.Subject无法转换为java.util.List

时间:2019-02-24 07:11:53

标签: android

需要从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));
            }
        }

0 个答案:

没有答案