Есть код:
Intent in=new Intent(Intent.ACTION_PICK,EXTERNAL_CONTENT_URI);
in.setType("image/*");
in=Intent.createChooser(in,"Виберіть картинку");
startActivityForResult(in,REQUEST_CODE);
Адрес я получаю content: // media / external / images / media / 8967
Однако Picasso не загружает его:
Picasso.with(getActivity()).load(recipe.getUrl()).into(imageView);
ну и
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE && resultCode == RESULT_OK) {
Uri uri;
if (data!=null)
{
uri=data.getData();
Recipe recipe=getRecipeFromFragment();
recipe.setUrl("file://" + uri.toString());
Log.i("uri", recipe.getUrl());
RecipeLab.getInstance(this).updateRecipe(recipe);
}
}
}