This article describes the Android implementation call system album and photo Demo sample. Share to everyone for your reference, specific as follows:
Recently, I have seen several people in the group talk about the Internet, some of the Android call system photo albums and photo demo have bugs, there are problems, not a complete. Yes, I remember one months ago, one of my classmates had this problem, and it was fine in a lower version of the system, and it crashed with a system above the 4.4 version. So, I still want to extract out, for everyone to tidy up, a relatively complete bug-free demo, let everyone collection, save for later use.
In fact, to call the phone library, the high version of the system will crash, because the acquisition method has changed, so we should make a judgment. The method is as follows:
Intent Intent;
if (Build.VERSION.SDK_INT <) {
intent = new Intent (intent.action_get_content);
Intent.settype ("image/*");
} else {
Intent = new Intent (
Intent.action_pick,android.provider.mediastore.images.media.external_content_ URI);
Startactivityforresult (Intent, request_code_picture);
This will easily solve the problem of the crash.
I hope this article will help you with the Android program.