数据库中的图像到Android的ListView

时间:2019-03-13 18:12:24

标签: android nullpointerexception android-bitmap

我试图在android的列表视图中显示数据库和此部分中的某些图像

from tkinter import *

master = Tk()

variable = StringVar(master)
variable.set("one") # default value

w = OptionMenu(master, variable, "one", "two", "three")
w.pack()

mainloop()

它给我以下错误:

  

java.lang.NullPointerException:尝试调用虚拟方法'int   空对象引用上的android.graphics.Bitmap.getWidth()'

1 个答案:

答案 0 :(得分:0)

const data = {
  "results": [
    {
      "gender": "female",
      "name": {
        "title": "miss",
        "first": "mia",
        "last": "sutton"
      }
    }
  ]
};

const displayUserPhotoAndName = (data) => {
  if(!data) return;
  const { results } = data;
  const { results: [profile] } = data;

  console.log(profile);
}

displayUserPhotoAndName(data);