From 66dcfd7b73f5adb447555f0f15e743a2ecc466e2 Mon Sep 17 00:00:00 2001 From: zeapo Date: Fri, 11 Aug 2017 10:25:37 +0200 Subject: suprress inflateParams lint error in dialogs --- .../main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java') diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java index 4edfc3e3..b0eb8fdd 100644 --- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java +++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java @@ -1,5 +1,6 @@ package com.zeapo.pwdstore.autofill; +import android.annotation.SuppressLint; import android.app.Activity; import android.app.Dialog; import android.app.DialogFragment; @@ -43,7 +44,7 @@ public class AutofillFragment extends DialogFragment { final AutofillPreferenceActivity callingActivity = (AutofillPreferenceActivity) getActivity(); LayoutInflater inflater = callingActivity.getLayoutInflater(); - final View view = inflater.inflate(R.layout.fragment_autofill, null); + @SuppressLint("InflateParams") final View view = inflater.inflate(R.layout.fragment_autofill, null); builder.setView(view); @@ -174,10 +175,11 @@ public class AutofillFragment extends DialogFragment { String packageName = getArguments().getString("packageName", ""); if (isWeb) { - packageName = ((EditText) dialog.findViewById(R.id.webURL)).getText().toString(); - // handle some errors and don't dismiss the dialog EditText webURL = (EditText) dialog.findViewById(R.id.webURL); + + packageName = webURL.getText().toString(); + if (packageName.equals("")) { webURL.setError("URL cannot be blank"); return; -- cgit v1.2.3