First of all, what kind of mobile phone does the questioner use? I have also encountered the first case of returning null. 1 Whether permissions are set 2 Whether the application takes up too much memory, which leads to an error when opening the camera
The second situation is easy to handle. Just get it But it may happen that the path you set is null
The occurrence of null is basically caused by insufficient memory. It’s best to check if there is a memory leak
First of all, what kind of mobile phone does the questioner use?
I have also encountered the first case of returning null.
1 Whether permissions are set
2 Whether the application takes up too much memory, which leads to an error when opening the camera
The second situation is easy to handle. Just get it
But it may happen that the path you set is null
The occurrence of null is basically caused by insufficient memory. It’s best to check if there is a memory leak
Post the error on logcat
Have you added permissions?
I have encountered this before. It seems that the requestcode returned by the fragment is negative. You can print it out and take a look.
Take a look here:
That’s where I answered.
There is one in the SCDN blog below.