openharmony 鸿蒙 changelogs-filemanagement

2023-10-30 浏览 (405)

File Subsystem Changelog

cl.file.1 Change of picker PhotoViewPicker.save() Compatibility

Changed the PhotoViewPicker.save() interface compatibility.

Change Impact

For applications developed based on earlier versions, PhotoViewPicker.save() saves files only to the file manager directory, and these files are invisible in Gallery. To save a file to Gallery, create a media asset using a security component. For details, see Creating a Media Asset Using a Security Component.

Key API/Component Changes

ModuleMethod/Attribute/Enum/ConstantChange Type
pickerfunction PhotoViewPicker.save(option?: PhotoSaveOptions) : Promise<Array<string>>Interface compatibility
pickerfunction PhotoViewPicker.save(option: PhotoSaveOptions, callback: AsyncCallback<Array<string>>) : voidInterface compatibility
pickerfunction PhotoViewPicker.save(callback: AsyncCallback<Array<string>>) : voidInterface compatibility

Adaptation Guide

PhotoViewPicker.save() starts FilePicker and saves files to a directory in the system file manager. From OpenHarmony_4.0.11.2, FilePicker cannot access assets in the media library. As a result, the files in the file manager directory cannot be viewed in Gallery. To enable the images or videos to be viewed in Gallery, use <SaveButton> to save images or videos.

Example

See Creating a Media Asset Using a Security Component.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI Subsystem Changelog

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/aadb255f000447a8a4c1ec074231cf79