je suivais le poste de
https://stackoverflow.com/a/10168114/5078763
et
http://www.theappguruz.com/blog/android-take-photo-camera-gallery-code-sample
modifié le code ci-dessousAndroid: Java image Picker de la galerie s'écraser question à GetBitmap
My App se bloque à
MediaStore.Images.Media.getBitmap
Il exécute ci-dessous Bfr Log
Log.d("TAG", "onActivityResult: bfr");
Mais pas Afr Log
Log.d("TAG", "onActivityResult: Afr");
Mon Achevé code comme ci-dessous:
void calGlryImjPkrFnc()
{
Intent glrImjPkrVar = new Intent(Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
glrImjPkrVar.setType("image/*");
startActivityForResult(glrImjPkrVar , 1);
}
void calCamImjPkrFnc()
{
Intent camImjPkrVar = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(camImjPkrVar, 2);
}
protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent)
{
super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
Bitmap pkdImjBitmapVar = null;
if(requestCode == 1 && resultCode == RESULT_OK)
{
Log.d("TAG",requestCode + "");
if (imageReturnedIntent != null)
{
try
{
ContentResolver contntMgrVaj = getApplicationContext().getContentResolver();
Uri uriVaj = imageReturnedIntent.getData();
Log.d("TAG", "onActivityResult: bfr");
pkdImjBitmapVar = MediaStore.Images.Media.getBitmap(contntMgrVaj, uriVaj);
Log.d("TAG", "onActivityResult: Afr");
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
else if(requestCode == 2 && resultCode == RESULT_OK)
{
pkdImjBitmapVar = (Bitmap) imageReturnedIntent.getExtras().get("data");
}
imjVyuVar.setImageBitmap(pkdImjBitmapVar);
}
Aidez-moi à réparer cet accident
Veuillez fournir une erreur logcat ici. –