I'm using RxImagePicker to take photos in my portrait-only-forced app:
RxImagePicker.with(getActivity()).requestImage(Sources.CAMERA).subscribe(new Action1<Uri>() {
@Override
public void call(Uri uri) {
RxImageConverters.uriToBitmap(getActivity(), uri).subscribe(new Action1<Bitmap>() {
@Override
public void call(final Bitmap bitmap) {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
//i take over here if we ever get here...
}
});
}
});
}
});
If I take a picture without rotating the device, it works (although the image is rotated but that's another issue). However, if I take a picture in landscape orientation, uriToBitmap is never called. It's not my activity or fragment being restarted, as everything's state is preserved inside my app.
What am I doing wrong?
It turned out to be something not-so-extraordinary.
I've simply forgot to update to the latest version and was using a few months old version of the library, which had the fix for the problem that I'm facing.
I've updated to the latest version and the problem went away.