简体   繁体   中英

Android attach specific file

Am working on an application in which I'd need to have a checkbox which when checked attaches a specific file from the SD card say, 'image1.jpg'. Anyone know how I can implement this?

You can hava an ImageView under your checkbox, and the visibility of this ImageView is GONE when checkbox is not checked by invoking bellow:

ImageView.setVisibility(View.GONE);

When checkbox is checked, you can change the visibility by the same method with another arg View.VISIBLE. Then you can display your image in ImageView. If ImageView is not your need, change it.

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