0
I have a big doubt, I passed an image from one screen to another and captured his URL, but I need to transform it to Bitmap, and exhibited it in a Imageview.
Follows my code:
public class ComentarActivity extends AppCompatActivity {
private EditText comentario;
private Button botaoSalvar;
private ImageView fotoSelecionada;
private String obID;
private ViewPager viewPager;
private TextView texto;
Context context;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_comentar);
comentario = (EditText) findViewById(R.id.text_comentario);
botaoSalvar = (Button) findViewById(R.id.button_salvar);
fotoSelecionada = (ImageView) findViewById(R.id.imageView2);
//passando uma foto da galeria para a imageviewe
Intent i = getIntent();
obID = i.getStringExtra("imagem");
byte[] decodedString = Base64.decode(obID, Base64.DEFAULT);
Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
Drawable foto = new BitmapDrawable(getResources(), decodedByte);
fotoSelecionada.setImageBitmap(foto);
Any suggestions??
Does this URL give access to an external image (from any site)? What problem with your code?
– Valdeir Psr
Did you mean URI? With Indian i? Or is it URL itself?
– WiseTap