Open the System album Intent Intent=new Intent (intent.action_get_content); Intent.settype ("image/*"); StartActivity (intent);
Opens the specified photo Intent intent = new intent (); intent.setaction (Android.content.Intent.ACTION_VIEW); intent.setdataandtype (Uri.fromfile (Picturefilepath), "image/*"); StartActivity (intent);
Open System Album Browse photos Intent Intent = new Intent (Intent.action_view, Uri.parse ("Content://media/internal/images/media")); StartActivity (Intent);
Use mediascannerconnection Scan to develop image files under the path and start the system album to browse
A class written by myself
public class Picturescanner implements mediascannerconnection.mediascannerconnectionclient{private Mediascannerconnection MMs; Private File Mfile; Private context context; File[] Allfiles; Public Picturescanner (Context context) {file folder = new File (Picturefolderpath); Allfiles = Folder.listfiles (); Swap (allfiles); This.context = context; Mfile = Allfiles[0]; MMs = new Mediascannerconnection (context, this); Mms.connect (); } public void onmediascannerconnected () {Mms.scanfile (Mfile.getabsolutepath (), NULL); } public void onscancompleted (String path, Uri uri) {Intent Intent = new Intent (Intent.action_view); Intent.setdata (URI); Context.startactivity (Intent); Mms.disconnect (); } private void Swap (File a[]) {int len = a.length; for (int i=0;i<len/2;i++) {File tmp = a[i]; A[i] = a[len-1-i]; A[len-1-i] = tmp; }}}
Call New Picturescanner (myactivity.this);
Android-Use System albums to browse photos under the specified path