从listView自动增量到Firestore文档
所以我有一个列表,可以填充我有一个微调项目。 然后我有一个文本框键入文档名称。 这两个都在工作
我需要的是我的代码自动检测我添加到列表中的项目数。 我不想手动添加它们。
我试过,但没有奏效
createListBtn.setOnClickListener { var item: String = "item" var i:Int = 1 var newItem: String = "item" + (Integer.parseInt(item.substring(1,item.length))+1) val list = HashMap<String, String>() list.put(newItem, kitList.toString()) db.collection("TestList").document(listNameTxt.text.toString()) .set(list as Map<String, Any>) .addOnSuccessListener { Log.d("TAG", "DocumentSnapshot successfully written!") } .addOnFailureListener { e -> Log.w("TAG1", "Error writing document") }
- 未解决的参考使用Android的Kotlin
- Android Studio中的Kotlin Room安装问题
- 当处于调试器模式时,Android Studio 1.5与Kotlin Plugin异常。 如何解决它?
- 如何做kotlin中的多个列表元素的总和
- Android Studio 3.0和gradle升级 – 创建apk时缺少base.apk代码
- 在Kotlin Android中出现错误“未解决的参考”
- 如何创建像anko – DSL语法Kotlin嵌套函数回调
- 用fillafter(true)|查看 kotlin | Android
- 在lite模式下的MapView在onSaveInstanceState调用时崩溃