Read your error message: a NullPointerException
occurs inside showExtraPicture()
. That's why it only happens with REQUEST_PICTURE_EXTRA
code.
You need to find what's null
and why. This is on line 388, so only you know, but I'd bet on view
being null
.
Whether it is or not anyway, you shouldn't hold onto your created root View
(assuming this is what view
reference here is). Just find your views from the attached Activity
each time you need it:
getActivity().findViewById(R.id.extra_image);
or from the fragment's root view works too if R.id.extra_image
is held inside it:
getView().findViewById(R.id.extra_image);
And, as a side note, you should close resources in finally: see the example in FileInputStream documentation.