matlab hater
matlab hater

Reputation: 163

Opening Gallery faster

Is there anyway to open Gallery faster through android studio? like the way facebook messenger does or whatsapp does? I making my own app and every time i tap the button to open gallery, it takes a few seconds. (I know it't not because of the phone because other apps open gallery really fast). Actually it's not that slow either but i'd really like it if it opened with a blink of an eye. Although I do have have a lot of computation on the images like resizing and changing orientations in onActivityResult(), but that shouldn't matter should it? btw here is my code for opening the gallery:

 public void openGallery(View view)
{
    Intent intent = new Intent();
    intent.setType("image/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);//
    startActivityForResult(Intent.createChooser(intent, "Select Picture"),IMAGE_GALLERY_REQUEST);

}

Can anyone help me with this?

Upvotes: 0

Views: 575

Answers (1)

Ali Hassan
Ali Hassan

Reputation: 519

Are you using Emulator? If so try Device. I am using this:

Intent i = new Intent(Intent.ACTION_PICK,
                        android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);

                startActivityForResult(i, IMAGE_GALLERY_REQUEST);

It takes only a second or less to open Gallery.

Upvotes: 2

Related Questions