diff options
author | Arne Schwabe <arne@rfc2549.org> | 2015-12-28 21:52:23 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2015-12-28 21:52:23 +0100 |
commit | 0a4c9cda1dacb3541f17dbb8e097310a65555680 (patch) | |
tree | 3f3e1c250902626d7189925ea3fcc30bcd726c2c | |
parent | de37e25defd096b9f31c27177ecbffeb4636da62 (diff) |
Fix lifecycle bug
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/fragments/FileSelectionFragment.java | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/FileSelectionFragment.java b/main/src/main/java/de/blinkt/openvpn/fragments/FileSelectionFragment.java index 3b146828..e3bcce41 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/FileSelectionFragment.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/FileSelectionFragment.java @@ -58,6 +58,22 @@ public class FileSelectionFragment extends ListFragment { @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { + @Override + public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { + onListItemClick(getListView(), view, position, id); + onFileSelectionClick(); + return true; + } + } + + ); + + } + + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.file_dialog_main, container, false); @@ -95,17 +111,6 @@ public class FileSelectionFragment extends ListFragment { mClearButton.setEnabled(false); } - getListView().setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { - @Override - public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { - onListItemClick(getListView(), view, position, id); - onFileSelectionClick(); - return true; - } - } - - ); - return v; } |