ServerDialog null check

This commit is contained in:
gdlbo
2022-06-25 14:50:12 +03:00
parent 67c0a3eed4
commit 58cddd18e2
@@ -24,16 +24,16 @@ import okhttp3.Response;
public class ServerDialog{
private static final OkHttpClient client = new OkHttpClient();
private static String title;
private static String message;
private static String positiveButton;
private static String negativeButton;
private static String link;
private static String key;
private static Boolean cancelable;
private static Boolean isNotForVerified;
private static String title = "";
private static String message = "";
private static String positiveButton = "";
private static String negativeButton = "";
private static String link = "";
private static String key = "";
private static Boolean cancelable = false;
private static Boolean isNotForVerified = false;
public static Boolean showAlert = true;
public static Boolean showAlert = false;
public static void alert(final Activity activity){
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
@@ -47,7 +47,7 @@ public class ServerDialog{
Intent a2 = new Navigator(VKUIwrapper.class).b(activity);
activity.startActivity(a2);
});
if(getBoolValue(key, true) && showForNotVerified()){
if(getBoolValue(key, true) && showForNotVerified() && showAlert){
builder.show();
}
}
@@ -93,6 +93,8 @@ public class ServerDialog{
return;
}
showAlert = true;
title = jSONObject.getString("title");
message = jSONObject.getString("message");
positiveButton = jSONObject.getString("positiveButton");