mercredi 13 mai 2015

intent.setType("image/*, video/*") not working on Samsung galaxy SII with android 2.3.3

I am trying to pick video and images from gallery. Below is my code -

 Intent intent = new Intent();                  
 intent.setType("image/*, video/*");                    
 intent.setAction(Intent.ACTION_GET_CONTENT);
 intent.addCategory(Intent.CATEGORY_OPENABLE);
 startActivityForResult(intent, requestCode);

this code is working on Samsung galaxy tab with android 4.0, micromax with android 4.1 and Htc evo with android 4.0. But the same code is not working for Samsung galaxy SII with android 2.3.3.In this case, when I go to gallery from my app it shows the gallery as blank. If I change the line

intent.setType("image/*, video/*");

to intent.setType("image/*"); or intent.setType("video/*"); then it works on Samsung SII also. Samsung SII is not allowing to set multiple types in intent.setType(). I need to know if this a problem with Samsung SII or with the android version.

Aucun commentaire:

Enregistrer un commentaire