Fix bugs: Selection state does not saved / Does not handle screen rotation properly

Bug 1:
 Selection state does not saved to SharedPreferences except for
 first time you open the dialog.

Bug 2:
 Due to does not handled screen rotation, the selection state would be
 reset when screen rotation occurred.