android: Avoid races between FragmentManager and state saving
authorTobias Brunner <tobias@strongswan.org>
Thu, 28 Apr 2016 17:35:56 +0000 (19:35 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 2 May 2016 16:38:15 +0000 (18:38 +0200)
commit7ab8ec7ad0456979d254c59b69c1f5895730b089
tree8855dac6472ddc94ac13fe8043bab61c219e0c2b
parent73a6bec3fcd9154123cd2f726b52eaeb677acb12
android: Avoid races between FragmentManager and state saving

onSaveInstanceState is apparently called after pausing the fragment and after
that committing any FragmentTransactions causes an IllegalStateException.
We could use commitAllowingStateLoss() but that's not really necessary
as we don't need to update when we are not active anyway.  We also don't
update the view directly after registration as this happens
asynchronously, i.e. we might be paused when it finishes.
src/frontends/android/app/src/main/java/org/strongswan/android/ui/ImcStateFragment.java