mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 03:19:24 +01:00
Prevent crash
This commit is contained in:
@@ -388,14 +388,12 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
final Context context = getContext();
|
||||
|
||||
final View dview = LayoutInflater.from(context).inflate(R.layout.dialog_pin_set, null);
|
||||
final View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_pin_set, null);
|
||||
final EditText etPin = dview.findViewById(R.id.etPin);
|
||||
|
||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context)
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getContext())
|
||||
.setView(dview)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
@@ -404,12 +402,12 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
|
||||
if (TextUtils.isEmpty(pin))
|
||||
prefs.edit().remove("pin").apply();
|
||||
else {
|
||||
boolean pro = ActivityBilling.isPro(context);
|
||||
boolean pro = ActivityBilling.isPro(getContext());
|
||||
if (pro) {
|
||||
Helper.setAuthenticated(context);
|
||||
Helper.setAuthenticated(getContext());
|
||||
prefs.edit().putString("pin", pin).apply();
|
||||
} else
|
||||
startActivity(new Intent(context, ActivityBilling.class));
|
||||
startActivity(new Intent(getContext(), ActivityBilling.class));
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user