I want to change the fragment settings in the app and I want to start with the image of the user that is the box below.
on the onCreate
mDatabase = FirebaseDatabase.getInstance().getReference().child( "Users" ).child( uiD );
mDatabase.addValueEventListener( new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
users = dataSnapshot.getValue( User.class );
url=users.getAvatar();
url();
}
@Override
public void onCancelled(final DatabaseError databaseError) {
}
} );
and then the method where imageview always gives me null. Comment that all this I do in the main activity and not in the Fragment. This same code works for me in another activity so I guess I'll need something for the fragment theme
public void url(){
if(imageview!=null){
Glide.with(this)
.load(url)
.into(imageview);
}
Toast.makeText( context, "ImagenSettings NULL", Toast.LENGTH_SHORT ).show();
}