Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/216.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何从mysql中获取图像并使用改进在recyclerview中显示_Android_Retrofit_Retrofit2_Android Recyclerview - Fatal编程技术网

Android 如何从mysql中获取图像并使用改进在recyclerview中显示

Android 如何从mysql中获取图像并使用改进在recyclerview中显示,android,retrofit,retrofit2,android-recyclerview,Android,Retrofit,Retrofit2,Android Recyclerview,我正在从mysql获取记录和图片,例如,我正在获取教师信息和图片。一切都很好,而不是抓取图像。如何获取图像并将其放置到recyclerview。我正在使用改装。 输入适配器 onBindViewHolder 这里是主要的活动响应 call.enqueue(new Callback<List<Teache_GetterAndSetter>>() { @Override public void onResponse(Call<List&l

我正在从mysql获取记录和图片,例如,我正在获取教师信息和图片。一切都很好,而不是抓取图像。如何获取图像并将其放置到recyclerview。我正在使用改装。 输入适配器

onBindViewHolder

这里是主要的活动响应

call.enqueue(new Callback<List<Teache_GetterAndSetter>>() {
        @Override
        public void onResponse(Call<List<Teache_GetterAndSetter>> call, Response<List<Teache_GetterAndSetter>> response) {
            subjects = response.body();
            adapter =new TeacherAdapterApi(subjects,getApplicationContext());
            recyclerView.setAdapter(adapter);
            dialog.dismiss();
        }
call.enqueue(新回调(){
@凌驾
公共void onResponse(调用、响应){
受试者=反应。身体();
adapter=新的教师AdapterAPI(主题,getApplicationContext());
recyclerView.setAdapter(适配器);
dialog.dismise();
}
注意:Php脚本是工作文件。 以下是php的回应: [{“T_id”:39,“T________________________________________mirzafahadi1122@gmail.com“,”T_num“:”03225898717“,”T_m_name“:”巴基斯坦“,”T_pic“:”a.png“,”房间“:”G-001“}]


问题是我没有从mysql获取图像。

你不能只返回图像。你需要将图像存储在某个地方,例如S3,然后返回图像存储的路径。使用piccso显示你的图像我如何使用毕加索?我不知道expert@jonathanrz如何将其存储在S3中?请查看此答复:
call.enqueue(new Callback<List<Teache_GetterAndSetter>>() {
        @Override
        public void onResponse(Call<List<Teache_GetterAndSetter>> call, Response<List<Teache_GetterAndSetter>> response) {
            subjects = response.body();
            adapter =new TeacherAdapterApi(subjects,getApplicationContext());
            recyclerView.setAdapter(adapter);
            dialog.dismiss();
        }