SimpleCropView icon indicating copy to clipboard operation
SimpleCropView copied to clipboard

After screen rotation Crop image view doesn't work.

Open amir5121 opened this issue 8 years ago • 3 comments

Crop image view doesn't respond to touch events after screen rotation. I got it working by restarting the activity but then SaveCallBack onError gets called instead of onSuccess.

amir5121 avatar Jul 13 '16 07:07 amir5121

Hi,

Can you describe more detail? The bug seems to not occured in my sample.(https://github.com/IsseiAoki/SimpleCropView/tree/master/simplecropview-sample)

igreenwood avatar Jul 15 '16 02:07 igreenwood

I took a look at the sample and apparently the instance of the fragment is saved during screen rotation. However in my case the cropImageView is owned by an activity which it's layout changes under screen rotations. I inspected my code further and realized that after screen rotation LoadCallback isn't being called (although i was calling startLoad method) causing the cropView to become unresponsive. So i stopped calling the mCropView.startLoad when savedInatanceState was not null and the issue was solved. I don't know if it's a bug.

amir5121 avatar Jul 15 '16 04:07 amir5121

Hi,

I understood what you said. It's not a bug. On screen rotation changed, Activity is automatically recreated. So, you cannot handle the asynchronous process that continues beyond screen rotation in Activity.

See this link below. http://www.androiddesignpatterns.com/2013/04/retaining-objects-across-config-changes.html

igreenwood avatar Jul 16 '16 15:07 igreenwood