简体   繁体   中英

Android widgets

如何将SD卡中的图片添加到在Android中显示某些图片的图片小部件中?

First, you will need to include an ImageView component on your widget than using one of the RemoteView function setImageViewUri(viewId, uri) you can load the image.

You will need to pass the ImageView ID and create an Uri pointing to the SDCARD.

Uri.fromFile(new File(Environment.getExternalStorageDirectory(),"file name"))"

Environment.getExternalStorageDirectory() - path to SDcard or any other external storage

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM