Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 65b0299

Browse files
committed
Not cancelable dialog when force update
1 parent c29d742 commit 65b0299

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

library/src/main/java/com/ackee/versioupdatehandler/UpdateDialog.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
4141
if (settings == null) {
4242
throw new IllegalArgumentException("Dialog settings cannot be null");
4343
}
44+
final boolean isForceUpdate = getArguments().getBoolean(FORCE_UPDATE_KEY, false);
45+
if(isForceUpdate) {
46+
setCancelable(false);
47+
builder.setCancelable(false);
48+
}
4449
String title = "Update app";
4550
if (settings.getTitle() != null) {
4651
title = settings.getTitle();
@@ -57,7 +62,6 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
5762
message = getString(settings.getMessageRes());
5863
}
5964
builder.setMessage(message);
60-
final boolean isForceUpdate = getArguments().getBoolean(FORCE_UPDATE_KEY, false);
6165

6266
String posButton = "Update";
6367
if (settings.getPositiveButton() != null) {

0 commit comments

Comments
 (0)