毕加索只想载入网址

时间:2018-08-19 12:08:50

标签: android-studio

这是我的代码:

private TextView userName, userMail;
private ImageView userPic;


private DrawerLayout drawer;
 DatabaseReference profileUserRef;
 StorageReference imageStoreReference;
 FirebaseAuth mAuth;
 String online_user_id;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_user_panel);

    mAuth = FirebaseAuth.getInstance();
    online_user_id = mAuth.getCurrentUser().getUid();
    imageStoreReference = FirebaseStorage.getInstance().getReference();
    profileUserRef = FirebaseDatabase.getInstance().getReference().child("Users").child(online_user_id);

    NavigationView mNavigationView = (NavigationView) findViewById(R.id.nav_view);
    View header = mNavigationView.getHeaderView(0);
    userName = (TextView) header.findViewById(R.id.userheaderName);
    userPic = (ImageView) header.findViewById(R.id.userheaderPic);

    profileUserRef.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {

            String name = dataSnapshot.child("username").getValue().toString();
            String imagePic = dataSnapshot.child("image").getValue().toString();

            Picasso.get().load(imagePic).into(userPic);

            userName.setText(name);


        }

        @Override
        public void onCancelled(DatabaseError databaseError) {

        }
    });

我想显示数据库中的图像,但是它不起作用。

但是,如果我从毕加索的.load()中的图片中写入URL,则会显示该图片。

有人可以帮我吗?

0 个答案:

没有答案