I'm trying to load an image from Firebase Storage, put it inside an ImageView and set it to the bottom navigation bar icon, here's my code:
DocumentReference df = fstore.collection("Users").document(user.getUid());
df.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
@Override
public void onComplete(@NonNull Task<DocumentSnapshot> task) {
if (task.isSuccessful())
{
DocumentSnapshot doc = task.getResult();
if (doc.exists())
{
if (doc.get("profilePictureUrl")!= null) { //set profile pic into image view
String downloadUrl = doc.get("profilePictureUrl").toString();
Glide.with(BottomNavigationActivity.this).load(downloadUrl).into(profileImg);
}
}
}
}
});
//set icon only accepts a drawable file
bottomNav.getMenu().getItem(4).setIcon(profileImg);'
but the setIcon method can only receive a drawable file, how do I solve this problem?