Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

on activity result camera intent return null in samsung s4


Thanks in advance for the help. Here is the issue that i am facing while creating my first app.

I am making app in which user have an option to take image from gallery or camera, when importing image from gallery the app is working as desired, but when image is taken from camera the 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);
like image 353
MostWant3d Avatar asked Oct 20 '22 04:10

MostWant3d


1 Answers

<activity
            android:name="com.example.AddPhotoActivity"
            android:label="Add Photo"
             android:configChanges="orientation|screenSize"
            android:screenOrientation="portrait"
          >

by adding this in manifest i can store my activty last state and then my activity is not started again but resume from previuos state and camera intent not return null

android:configChanges="orientation|screenSize"
like image 137
MostWant3d Avatar answered Nov 03 '22 02:11

MostWant3d