January 2014
Intermediate to advanced
736 pages
70h 43m
English
Method saveImage (Fig. 7.32) saves the current drawing to a file in the device’s gallery. Line 271 creates a filename for the image, then lines 274–276 store the image in the device’s Gallery by calling class MediaStore.Images.Media’s insertImage method. The method receives four arguments:
• a ContentResolver that the method uses to locate where the image should be stored on the device
• the Bitmap to store
• the name of the image
• a description of the image
267 // save the current image to the Gallery268 public void saveImage()269 {270 // use "Doodlz" followed by current time as the image name271 String name = "Doodlz" + System.currentTimeMillis() + ".jpg" ...
Read now
Unlock full access