1

I wanted to add cameraIntent in my app but whenever I try to capture an image the image gets blurred I'll leave the code below someone please help me out.

ShareActivity

tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
        @Override
        public void onTabSelected(TabLayout.Tab tab) {
            if (tab.getPosition() == 1){
                checkPermissions(Permissions.CAMERA_PERMISSIONS[0]);
                Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                startActivityForResult(cameraIntent, CAMERA_REQUEST_CODE);

            }
        }

        @Override
        public void onTabUnselected(TabLayout.Tab tab) {

        }

        @Override
        public void onTabReselected(TabLayout.Tab tab) {

        }
    });

}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == CAMERA_REQUEST_CODE) {
        Log.d(TAG, "onActivityResult: done taking a photo.");
        Log.d(TAG, "onActivityResult: attempting to navigate tofinal share screen");
        //navigate to the final share screen to publish photo
    }
Alex Cohn
  • 56,089
  • 9
  • 113
  • 307
Harris
  • 31
  • 1
  • 1
    You should not use **data** that is returned from intent as the resulting image. It's only a thumbnail. The full-res picture is waiting for you in the camera roll. – Alex Cohn Aug 14 '19 at 15:10
  • But then how do I fix the blurred image which returns from the intent? – Harris Aug 15 '19 at 08:54
  • Possible duplicate of *[Low picture/image quality when capture from camera](https://stackoverflow.com/a/10382217/192373)* – Alex Cohn Aug 15 '19 at 11:48
  • See a more modern [aswer](https://stackoverflow.com/a/45388858/192373) that shows the use of FIleProvider for Android 7 and up. – Alex Cohn Aug 15 '19 at 11:55

0 Answers0