firebase putfile在kotlin中

时间:2017-12-15 13:17:43

标签: firebase kotlin firebase-storage

putFile()方法显示kotlin中未解析的引用

 override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        if(requestCode==Gallery_Intent && resultCode == Activity.RESULT_OK ) {
            val uri = data!!.data
            val imgstr = FirebaseStorage.getInstance().getReference().child("images")
            uri.putFile(imgstr)
    }

uri.putFile(imgstr)显示错误该怎么办?

1 个答案:

答案 0 :(得分:1)

putfile()StorageReference的一种方法。代码应该是:

imgstr.putFile(uri)