Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. @OnClick(R.id.fab_take_photo)
  2. public void onTakePhoneButtonClicked() {
  3. lock();
  4. FileOutputStream outputPhoto = null;
  5. try {
  6. outputPhoto = new FileOutputStream(createImageFile(galleryFolder));
  7. textureView.getBitmap()
  8. .compress(Bitmap.CompressFormat.PNG, 100, outputPhoto);
  9. } catch (Exception e) {
  10. e.printStackTrace();
  11. } finally {
  12. unlock();
  13. try {
  14. if (outputPhoto != null) {
  15. outputPhoto.close();
  16. }
  17. } catch (IOException e) {
  18. e.printStackTrace();
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement