summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/Provider.java5
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/ProviderListAdapter.java10
2 files changed, 11 insertions, 4 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/Provider.java b/app/src/main/java/se/leap/bitmaskclient/Provider.java
index a7ede2d1..f22a4bfb 100644
--- a/app/src/main/java/se/leap/bitmaskclient/Provider.java
+++ b/app/src/main/java/se/leap/bitmaskclient/Provider.java
@@ -200,4 +200,9 @@ public final class Provider implements Parcelable {
}
return json;
}
+
+ @Override
+ public int hashCode() {
+ return main_url.hashCode();
+ }
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/ProviderListAdapter.java b/app/src/main/java/se/leap/bitmaskclient/ProviderListAdapter.java
index 72ca15c7..19a9a089 100644
--- a/app/src/main/java/se/leap/bitmaskclient/ProviderListAdapter.java
+++ b/app/src/main/java/se/leap/bitmaskclient/ProviderListAdapter.java
@@ -90,10 +90,12 @@ public class ProviderListAdapter extends RendererAdapter<Provider> {
@Override
public void add(Provider item) {
super.add(item);
- boolean[] new_hidden = new boolean[hidden.length+1];
- System.arraycopy(hidden, 0, new_hidden, 0, hidden.length);
- new_hidden[hidden.length] = false;
- hidden = new_hidden;
+ if(getCollection().size() < hidden.length) {
+ boolean[] new_hidden = new boolean[hidden.length + 1];
+ System.arraycopy(hidden, 0, new_hidden, 0, hidden.length);
+ new_hidden[hidden.length] = false;
+ hidden = new_hidden;
+ }
}
@Override