【问题标题】:Get error when trying to read data form fire base尝试从 firebase 读取数据时出错
【发布时间】:2022-06-14 22:43:17
【问题描述】:

我尝试从 firebase 获取数据,但出现此错误

.ShowDatabase$1.onDataChange(ShowDatabase.java:41)

我的代码是:

        inventoryDbRef.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(@NonNull DataSnapshot snapshot) {
            inventoryList.clear();

            for (DataSnapshot inventoryDatasnap : snapshot.getChildren()){
                Inventory inventory = inventoryDatasnap.getValue(Inventory.class);
                inventoryList.add(inventory);

            }
            ListAdapter adapter = new ListAdapter(ShowDatabase.this,inventoryList);
            myListView.setAdapter(adapter);

        }

【问题讨论】:

  • 您的应用程序崩溃了吗?如果是这样,则存在堆栈跟踪。请在 logcat 上查找,并将其添加到您的问题中。

标签: java android database firebase


猜你喜欢
  • 1970-01-01
  • 2018-07-15
  • 2018-11-08
  • 1970-01-01
  • 1970-01-01
  • 2023-02-23
  • 1970-01-01
  • 2018-04-16
  • 2014-01-28
相关资源
最近更新 更多