darsh2 / MultipleImageSelect

Android library that provides for multiple image selection.
Apache License 2.0
300 stars 112 forks source link

Bug when orientation is changed #31

Closed darsh2 closed 8 years ago

darsh2 commented 8 years ago

Steps to reproduce:

  1. Select any album
  2. Select any image(s)
  3. Change orientation from portrait to landscape or vice versa
  4. Press ADD

A new instance of AlbumSelectActivity opens. This is one of a few ways of reproducing this bug. It occurs only when there is an orientation change on using the library. Log reads:

Duplicate finish request for ActivityRecord{1579d8c u0 com.darsh.example.sample/com.darsh.multipleimageselect.activities.AlbumSelectActivity t1162 f}

Bug occured in commit 09bf41c on altering permission request logic.

Temporary fix: Use any of the released versions of library or any commit on or before commit 088585b.

darsh2 commented 8 years ago

The bug was due to the fact that on orientation change, the MainActivity of the sample was recreated. In it's onCreate method, AlbumSelectActivity is started and hence it would restart. This was verified by preventing MainActivity of the sample recreation by overriding configuration changes - the library worked as expected.