使用firebase运行的我的应用程序和成功上传图片编码为我的json
字符串我的Json on Firebase
@Override
public void onBindViewHolder(MyHolder holder, int position) {
String name = movies.get(position).getName();
String desk = movies.get(position).getDescription();
holder.nameTxt.setText(name);
holder.tvDesk.setText(desk);
String image = movies.get(position).getImageFile();
byte[] decodedString = Base64.decode(image, Base64.DEFAULT);
Bitmap bitmap = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
holder.ivprofile.setImageBitmap(bitmap);
PiccassoClient.downloadImage(c,movies.get(position).getUrl(),holder.img);
}
logcat的
FATAL EXCEPTION: main Process: com.squad.utif.rvtext, PID: 2543
Theme: themes:{} java.lang.NullPointerException: Attempt to invoke virtual method 'byte[] java.lang.String.getBytes()' on a null object reference
at android.util.Base64.decode(Base64.java:118)
at com.squad.utif.rvtext.Recycler.MyAdapter.onBindViewHolder(MyAdapter.java:49)
at com.squad.utif.rvtext.Recycler.MyAdapter.onBindViewHolder(MyAdapter.java:23)
编码出了什么问题?