Android calls system albums and crops

Source: Internet
Author: User

Previous write about calling system camera and cropping, this piece of writing about calling system albums cropping photos

Btn_album.setonclicklistener (New Onclicklistener () {

@Override
public void OnClick (View v) {
Intent Intent;
Logotemppath = Logo_base_path + system.currenttimemillis () + ". png";
Intent = new Intent (Intent.action_pick, NULL);
Intent.settype ("image/*");
Startactivityforresult (Intent, photo_album);
}
});

The above is to click on a button to call the system camera, temporary file name definition reason is the same as before the camera call

-------------------------------------------------------------------------------------

if (Requestcode = = Photo_album) {//from album
if (data = = NULL | | data.getdata () = = null)
Toast.maketext (Getapplicationcontext (), "Get failed from album", Toast.length_short). Show ();
Else
Startphotozoom (Data.getdata ());

}

The above is the Onactivityresult method to return data when the operation, some phone return data may be empty, it is necessary to add a judgment

Startphotozoom (Data.getdata ()); The method is the same as the method in the previous article.

----------------------------------------------------------------------------------

When you call a photo album you don't have so many problems as when you call the camera, here's so much, what's the problem you can come up with to discuss research ^_^

Android calls system albums and crops

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.