Android studio Android Studio如何知道图像是否已从Firebase更新?

Android studio Android Studio如何知道图像是否已从Firebase更新?,android-studio,firebase,firebase-storage,Android Studio,Firebase,Firebase Storage,因此,我使用Firebase存储中的图像设置了imageView。图像将下载到应用程序缓存中,以便脱机使用。 但是,如果图像已更改,并且图像具有相同的名称,我如何使用代码来实现这一点 (图像显示在手机上,但当我在firebase存储中更改图像时,图像在手机上保持不变) 这是我的 ImageView i1 = (ImageView) findViewById(R.id.imageView); ImageView i2 = (ImageView) findViewById(R.id.

因此,我使用Firebase存储中的图像设置了imageView。图像将下载到应用程序缓存中,以便脱机使用。 但是,如果图像已更改,并且图像具有相同的名称,我如何使用代码来实现这一点

(图像显示在手机上,但当我在firebase存储中更改图像时,图像在手机上保持不变)

这是我的

    ImageView i1 = (ImageView) findViewById(R.id.imageView);
    ImageView i2 = (ImageView) findViewById(R.id.imageView1);
    ArrayList<ImageView> images = new ArrayList<>(2);
    images.add(i1);
    images.add(i2);
    String str = "images.jpg";
        for (int i = 0; i < images.size(); i++) {
            str = str.substring(0,6) + i + ".jpg";
            StorageReference storageReference = FirebaseStorage.getInstance().getReference().child(str);
            Glide.with(this).using(new FirebaseImageLoader()).load(storageReference).into(images.get(i));
        }
ImageView i1=(ImageView)findviewbyd(R.id.ImageView);
ImageView i2=(ImageView)findViewById(R.id.imageView1);
ArrayList图像=新的ArrayList(2);
添加(i1);
添加(i2);
String str=“images.jpg”;
对于(int i=0;i

如何知道图像是否已更改,但名称相同?

您可以使用写入一个文件,每当存储桶中的文件发生更改时执行该文件。然后,您可以让它使用Firebase云消息向您的应用程序发送通知。

我已经研究了云功能,这正是我所需要的。但我不知道如何处理他们的代码。我输入它,就会得到编译错误。如果有人能给我举个例子,那就太棒了。