Guest User

Untitled

a guest
Apr 22nd, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. btTirarFoto.setOnClickListener(new View.OnClickListener() {
  2. @Override
  3. public void onClick(View view) {
  4.  
  5. Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
  6. startActivityForResult(intent, 0);
  7.  
  8.  
  9. }
  10. });
  11.  
  12. @Override
  13. public void onActivityResult(int requestCod, int resultCode, Intent data){
  14. if (data != null){
  15. Bundle bundle = data.getExtras();
  16. if (bundle != null){
  17. Bitmap img = (Bitmap) bundle.get("data");
  18.  
  19. campoImg1.setVisibility(View.VISIBLE);
  20.  
  21. campoImg1.setImageBitmap(img);
  22.  
  23.  
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment