Android-Kotlin:BitmapFactory给出了nullpointer异常

时间:2018-03-27 04:18:38

标签: android kotlin bitmapfactory

这是我的代码

 private fun initDesign(imageList: List<ImageList>) {
        //Initialize with empty data

        for (i in 0 until imageList.size) {

            val imageDataBytes = imageList.get(i).image
            val iD = Integer.parseInt(imageList.get(i).imageIndex)
            val  imageAsBytes : ByteArray  = Base64.decode(imageDataBytes,0)
            bitmaps !!.add(BitmapFactory.decodeByteArray(imageAsBytes, 0, imageAsBytes.size))
            imageID!!.add(iD)
        }
}

此代码有什么问题

0 个答案:

没有答案