aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Wong <wongma@protonmail.ch>2015-12-31 07:20:48 -0500
committerMatthew Wong <wongma@protonmail.ch>2015-12-31 07:20:48 -0500
commita3e10d3ca83c78f19d342a76caebefa924b8d705 (patch)
treee85eacfc37c2cf07fe97fa9bae8555c5ec3c780b
parentc3b87f5b18aabf0da72f48259463e4d66ddf6dc7 (diff)
Fix 'Delete' nullpointerexception and revert to working URL-getting
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java3
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java7
2 files changed, 5 insertions, 5 deletions
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 1ebf4828..474c3e35 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillFragment.java
@@ -137,7 +137,8 @@ public class AutofillFragment extends DialogFragment {
builder.setNeutralButton(R.string.autofill_apps_delete, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- if (packageName != null && !packageName.equals("")) {
+ if (((AutofillPreferenceActivity) getActivity()).recyclerAdapter != null
+ && packageName != null && !packageName.equals("")) {
editor.remove(packageName);
((AutofillPreferenceActivity) getActivity()).recyclerAdapter.removeWebsite(packageName);
editor.apply();
diff --git a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java
index c17d25d5..305dfdfa 100644
--- a/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java
+++ b/app/src/main/java/com/zeapo/pwdstore/autofill/AutofillService.java
@@ -111,10 +111,9 @@ public class AutofillService extends AccessibilityService {
webViewURL = null;
if (webViewTitle != null) {
- List<AccessibilityNodeInfo> nodes = new ArrayList<>();
- if (event.getSource().getPackageName().equals("com.android.chrome")) {
- nodes = getRootInActiveWindow().findAccessibilityNodeInfosByViewId("com.android.chrome:id/url_bar");
- } else if (event.getSource().getPackageName().equals("com.android.browser")) {
+ List<AccessibilityNodeInfo> nodes = getRootInActiveWindow()
+ .findAccessibilityNodeInfosByViewId("com.android.chrome:id/url_bar");
+ if (nodes.size() == 0) {
nodes = getRootInActiveWindow().findAccessibilityNodeInfosByViewId("com.android.browser:id/url");
}
for (AccessibilityNodeInfo node : nodes)