From 8ced9f378613425efb9949196e967dbe2f03a63a Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Thu, 7 Nov 2013 22:40:51 +0100 Subject: Fine tune log window. --HG-- rename : res/layout-w720dp/log_fragment.xml => res/layout-sw600dp/log_fragment.xml rename : res/values-w600dp/dimens.xml => res/values-sw600dp/dimens.xml --- src/de/blinkt/openvpn/fragments/VPNProfileList.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/de/blinkt/openvpn/fragments/VPNProfileList.java') diff --git a/src/de/blinkt/openvpn/fragments/VPNProfileList.java b/src/de/blinkt/openvpn/fragments/VPNProfileList.java index 2b03048f..447ed1e0 100644 --- a/src/de/blinkt/openvpn/fragments/VPNProfileList.java +++ b/src/de/blinkt/openvpn/fragments/VPNProfileList.java @@ -33,10 +33,12 @@ public class VPNProfileList extends ListFragment { private static final int START_VPN_CONFIG = 92; private static final int SELECT_PROFILE = 43; private static final int IMPORT_PROFILE = 231; + private static final int FILE_PICKER_RESULT = 392; private static final int MENU_IMPORT_PROFILE = Menu.FIRST +1; - class VPNArrayAdapter extends ArrayAdapter { + + class VPNArrayAdapter extends ArrayAdapter { public VPNArrayAdapter(Context context, int resource, int textViewResourceId) { @@ -199,14 +201,22 @@ public class VPNProfileList extends ListFragment { onAddProfileClicked(); return true; } else if (itemId == MENU_IMPORT_PROFILE) { - startImportConfig(); + //startImportConfig(); + startFilePicker(); return true; } else { return super.onOptionsItemSelected(item); } } - private void startImportConfig() { + private void startFilePicker() { + Intent i = new Intent(Intent.ACTION_OPEN_DOCUMENT); + i.addCategory(Intent.CATEGORY_OPENABLE); + i.setType("application/x-openvpn-profile"); + startActivityForResult(i,FILE_PICKER_RESULT); + } + + private void startImportConfig() { Intent intent = new Intent(getActivity(),FileSelect.class); intent.putExtra(FileSelect.NO_INLINE_SELECTION, true); intent.putExtra(FileSelect.WINDOW_TITLE, R.string.import_configuration_file); -- cgit v1.2.3