android: Use Activity as context for VpnProfileAdapter to fix theme
authorTobias Brunner <tobias@strongswan.org>
Fri, 15 Apr 2016 11:21:22 +0000 (13:21 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 27 Apr 2016 12:24:27 +0000 (14:24 +0200)
When using the application context theme customizations wouldn't get
applied for some reason.

src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileListFragment.java

index fb684b5..a23df05 100644 (file)
@@ -109,15 +109,13 @@ public class VpnProfileListFragment extends Fragment
                        setHasOptionsMenu(true);
                }
 
                        setHasOptionsMenu(true);
                }
 
-               Context context = getActivity().getApplicationContext();
-
                mDataSource = new VpnProfileDataSource(this.getActivity());
                mDataSource.open();
 
                /* cached list of profiles used as backend for the ListView */
                mVpnProfiles = mDataSource.getAllVpnProfiles();
 
                mDataSource = new VpnProfileDataSource(this.getActivity());
                mDataSource.open();
 
                /* cached list of profiles used as backend for the ListView */
                mVpnProfiles = mDataSource.getAllVpnProfiles();
 
-               mListAdapter = new VpnProfileAdapter(context, R.layout.profile_list_item, mVpnProfiles);
+               mListAdapter = new VpnProfileAdapter(getActivity(), R.layout.profile_list_item, mVpnProfiles);
        }
 
        @Override
        }
 
        @Override