title: Button to start the Gallery on Android
body: <p>I'm trying to make a button in my App open the built in gallery. </p>
  
  <pre><code>public void onClick(View v) {
                  Intent intentBrowseFiles = new Intent(Intent.ACTION_VIEW);
                  intentBrowseFiles.setType("image/*");
                  intentBrowseFiles.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                  startActivity(intentBrowseFiles);                   
              }
  </code></pre>
  
  <p>This results in an error message "The application Camera (process com.android.gallery) has stopped unexpectedly."</p>
  
  <p>If I set the Intent action to ACTION_GET_CONTENT it manages to open the gallery but then simply returns the image to my app when a picture is selected which is not what I want. </p>