Fix #939.
This commit is contained in:
parent
8419f8d0e9
commit
22e90743aa
|
@ -70,16 +70,25 @@ public class BolusProgressDialog extends DialogFragment implements View.OnClickL
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
if (getDialog() != null)
|
if (bolusEnded) {
|
||||||
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
dismiss();
|
||||||
MainApp.bus().register(this);
|
} else {
|
||||||
running = true;
|
if (getDialog() != null)
|
||||||
if (bolusEnded) dismiss();
|
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
|
MainApp.bus().register(this);
|
||||||
|
running = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dismiss() {
|
public void dismiss() {
|
||||||
super.dismiss();
|
try {
|
||||||
|
super.dismiss();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
// dialog not running yet. onResume will try again. Set bolusEnded to make extra
|
||||||
|
// sure onResume will catch this
|
||||||
|
bolusEnded = true;
|
||||||
|
}
|
||||||
if (helperActivity != null) {
|
if (helperActivity != null) {
|
||||||
helperActivity.finish();
|
helperActivity.finish();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue