From 3af02771543a45f7b1f1f3ac557f5ad268cca73b Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Fri, 4 Mar 2016 15:35:31 +0100 Subject: Referees VPN list on activity resume --- .../main/java/de/blinkt/openvpn/fragments/VPNProfileList.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'main/src') 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 allvpn = getPM().getProfiles(); + if (mArrayadapter==null) { + mArrayadapter = new VPNArrayAdapter(getActivity(), R.layout.vpn_list_item, R.id.vpn_item_title); + } + Collection allvpn = getPM().getProfiles(); TreeSet sortedset = new TreeSet(new VpnProfileNameComparator()); sortedset.addAll(allvpn); + mArrayadapter.clear(); mArrayadapter.addAll(sortedset); setListAdapter(mArrayadapter); + mArrayadapter.notifyDataSetChanged(); } -- cgit v1.2.3