According to the action, the result of the camera is the intention to return null to samsung s4


Thank you in advance. Here is the problem that I have to face when creating my first application.

I am creating an application in which the user has the opportunity to take an image from the gallery or camera, when importing the image from the gallery, the application works as desired, but when the image is taken from the camera, intent returns null .

 Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri); startActivityForResult(cameraIntent,YOUR_SELECT_PICTURE_REQUEST_CODE); 
+5
source share
1 answer
 <activity android:name="com.example.AddPhotoActivity" android:label="Add Photo" android:configChanges="orientation|screenSize" android:screenOrientation="portrait" > 

adding this to the manifest, I can save the last state of my activity, and then my activity does not start again, but resumes from the previuos state and the camera intends not to return null

 android:configChanges="orientation|screenSize" 
+3
source

All Articles