无法使用auth在Firebase数据库中显示存储当前用户名

时间:2019-07-12 12:51:27

标签: java android firebase firebase-authentication

除用户名外,所有内容都存储在数据库中,但我不确定为什么,这是代码

nuser= (FirebaseAuth.getInstance().getCurrentUser().getDisplayName()).toString();

userListView.setOnItemClickListener(new AdapterView.OnItemClickListener() 
{    

    @Override
    public void onItemClick (AdapterView<?> adapterView, View view,int i, long l) 
    {

        HashMap<String, String> dataMap = new HashMap<>();
        dataMap.put("fromWhom",nuser);
        dataMap.put("imageIdentifier", imageIdentifier);
        dataMap.put("imageLink", uploadedImageLink);
        dataMap.put("des", edit_description.getText().toString());
        FirebaseDatabase.getInstance()
            .getReference().child("app_users")
            .child(UIDs.get(i)).child("received_posts")
            .push().setValue(dataMap);
    }
});

0 个答案:

没有答案