(Android)如何通过编程更改已存储在gallery中的图像的名称

(Android)如何通过编程更改已存储在gallery中的图像的名称,android,amazon-web-services,Android,Amazon Web Services,我正在制作一个应用程序,其中我必须上传已经存储在AWS服务器上的图片库中的图片。问题是我必须根据时间戳命名这些图片,即它们被上传的时间。下面是用于从图片库中获取图片的代码。 Beginupload是我用来上传AWS bucket中图像的方法 @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) {

我正在制作一个应用程序,其中我必须上传已经存储在AWS服务器上的图片库中的图片。问题是我必须根据时间戳命名这些图片,即它们被上传的时间。下面是用于从图片库中获取图片的代码。 Beginupload是我用来上传AWS bucket中图像的方法

@Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        switch (requestCode) {
            case REQUEST_CODE_Gallery: {
                if (requestCode == REQUEST_CODE_Gallery
                        && resultCode == Activity.RESULT_OK)

                {
                    Uri uri = data.getData();

                        try {
                            String path = getPath(uri);
                           // String p=path.replace(path, timeStamp+".jpg");
                            beginUpload(path);

                        } catch (URISyntaxException e) {
                            Toast.makeText(this,
                                    "Unable to get the file from the given URI.  See error log for details",
                                    Toast.LENGTH_LONG).show();
                            Log.e(TAG, "Unable to upload file from the given uri", e);
                        }

您不能使用存储在该图像的EXIF数据中的图像的时间戳吗?否…我需要将名称更改为照片上载到AWS的时间。有人会回复吗?尝试创建所需的重复图像并重命名,然后上载该图像