Android uses intent to call pictures, videos, audios, recordings, and photos.

Source: Internet
Author: User
// Select intent = new intent (intent. action_get_content); // "android. intent. action. get_content "intent. settype (contenttype); // view type string image_unspecified = "image/*"; intent wrapperintent = intent. createchooser (intent, null); (activity) context ). startactivityforresult (wrapperintent, requestcode); // Add the audio intent = new intent (intent. action_get_content); intent. settype (contenttype); // string video_unspecified = "Video/*"; intent wrapperintent = intent. createchooser (intent, null); (activity) context ). startactivityforresult (wrapperintent, requestcode); // The Int durationlimit = getvideocapturedurationlimit (); // systemproperties. getint ("Ro. media. ENC. lprof. duration ", 60); intent = new intent (mediastore. action_video_capture); intent. putextra (mediastore. extra_video_quality, 0); intent. putextra (mediastore. extra_size_limit, sizelimit); intent. putextra (mediastore. extra_duration_limit, durationlimit); startactivityforresult (intent, request_code_take_video); // video intent = new intent (intent. action_get_content); intent. settype (contenttype); // string video_unspecified = "Video/*"; intent wrapperintent = intent. createchooser (intent, null); (activity) context ). startactivityforresult (wrapperintent, requestcode); // recording intent = new intent (intent. action_get_content); intent. settype (contenttype. audio_amr); // string audio_amr = "audio/AMR"; intent. setclassname ("com. android. soundrecorder "," com. android. soundrecorder. soundrecorder "); (activity) context ). startactivityforresult (intent, requestcode); // photographed request_code_take_picture as the returned identifier intent = new intent (mediastore. action_image_capture); // "android. media. action. image_capture "; intent. putextra (mediastore. extra_output, MMs. scrapspace. content_uri); // output, Uri. parse ("content: // MMS/scrapspace"); startactivityforresult (intent, request_code_take_picture );
Related Article

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.