public class About extends AppCompatActivity {
ImageView imageView;
TextView textView;
String mediaUrL;
private FirebaseFirestore firebaseFirestore;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
firebaseFirestore = FirebaseFirestore.getInstance();
imageView = findViewById(R.id.showGraphImage);
textView = findViewById(R.id.jkbdsjfdvshf);
firebaseFirestore.collection("crimeData").document("graph").get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot snapshot) {
mediaUrL = snapshot.getString("imageUrl");
textView.setText(mediaUrL);
System.out.println(snapshot.getString("imageUrl"));
}
});
Glide.with(this).load(mediaUrL).into(imageView);
System.out.println(mediaUrL);
I am new to android and I am using Cloud Firestore to store the data online .the variable mediaUrl prints on the console but don't show in the activity. I got the answer but still, now it is not working. Further, I added a used mediaUrl to display the image but it is also not showing on the activity.