summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2016-03-04 15:35:31 +0100
committerArne Schwabe <arne@rfc2549.org>2016-03-07 09:10:57 +0100
commit3af02771543a45f7b1f1f3ac557f5ad268cca73b (patch)
treedef93bf68b9ff01c7d22cd581e5e175d76e833cc /main/src
parent1fbdec744ea40b9ce330e6170c6bb863b69b2e05 (diff)
Referees VPN list on activity resume
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java
index db7fe038..3f5e806e 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/VPNProfileList.java
@@ -149,6 +149,7 @@ public class VPNProfileList extends ListFragment implements OnClickListener, Vpn
@Override
public void onResume() {
super.onResume();
+ setListAdapter();
VpnStatus.addStateListener(this);
}
@@ -211,14 +212,18 @@ public class VPNProfileList extends ListFragment implements OnClickListener, Vpn
}
private void setListAdapter() {
- mArrayadapter = new VPNArrayAdapter(getActivity(), R.layout.vpn_list_item, R.id.vpn_item_title);
- Collection<VpnProfile> allvpn = getPM().getProfiles();
+ if (mArrayadapter==null) {
+ mArrayadapter = new VPNArrayAdapter(getActivity(), R.layout.vpn_list_item, R.id.vpn_item_title);
+ }
+ Collection<VpnProfile> allvpn = getPM().getProfiles();
TreeSet<VpnProfile> sortedset = new TreeSet<VpnProfile>(new VpnProfileNameComparator());
sortedset.addAll(allvpn);
+ mArrayadapter.clear();
mArrayadapter.addAll(sortedset);
setListAdapter(mArrayadapter);
+ mArrayadapter.notifyDataSetChanged();
}