Zajmuję się tworzeniem aplikacji, w której obraz jest pobierany z natywnej aplikacji aparatu. ma być pokazywany użytkownikowi. Kod Zrobiłem to:Android Samsung: aplikacja aparatu nie zwróci intent.getData()
/* Intent */
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
startActivityForResult(intent, TAKE_PICTURE);
/* Result */
onActivityResult(int requestCode, int resultCode,
Intent returnIntent) {
if(requestCode == TAKE_PICTURE) {
//picture from Camera
if (resultCode == Activity.RESULT_OK) {
if(returnIntent != null) {
try {
// Get the file path where the image is stored.
// This runs fine on all devices, except Samsung ones.
Uri selectedImage = returnIntent.getData();
if(selectedImage == null) {
if(returnIntent.getExtras() != null &&
returnIntent.getExtras().get(AppConstants.DATA) != null) {
// But, I get the image Bitmap here. Means the image is stored in disk.
Bitmap bmp = (Bitmap) returnIntent.getExtras().get(AppConstants.DATA);
}
}
} catch (Exception e) {
//
}
}
}
}
}
Problemem jest tutaj, powyższy kod działa poprawnie na wszystkich urządzeniach próbowałem (HTC, SE), ale jakoś nie w tych, Samsung. "Uri selectedImage = returnIntent.getData();" nigdy nie zwraca niczego. Ponieważ cała moja aplikacja jest zbudowana na tej logice przechowywania ścieżek plików, nie mogę kontynuować. Czy jest jakieś rozwiązanie ludzi.
znalazłeś rozwiązanie? – Sharj