// ////////////////////////////////////////////////////////////////////// // ACTIONS // ////////////////////////////////////////////////////////////////////// @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case PublicIntent.REQUESTCODE_FILEPICKER: if (data != null && IntentIntegrator.ACTION_PICK_FILE.equals(data.getAction())) { ActionManager.actionPickFile( getFragmentManager().findFragmentByTag(TAG), IntentIntegrator.REQUESTCODE_FILEPICKER); } else if (data != null && data.getData() != null) { String tmpPath = ActionManager.getPath(getActivity(), data.getData()); if (tmpPath != null) { tmpFile = new File(tmpPath); } else { // Error case : Unable to find the file path associated // to user pick. // Sample : Picasa image case ActionManager.actionDisplayError( this, new AlfrescoAppException(getString(R.string.error_unknown_filepath), true)); } } else if (data != null && data.getExtras() != null && data.getExtras().containsKey(Intent.EXTRA_STREAM)) { List<File> files = new ArrayList<File>(); List<Uri> uris = data.getExtras().getParcelableArrayList(Intent.EXTRA_STREAM); for (Uri uri : uris) { files.add(new File(ActionManager.getPath(getActivity(), uri))); } createFiles(files); } break; default: break; } }
// ////////////////////////////////////////////////////////////////////// // ACTION BAR ITEM // ////////////////////////////////////////////////////////////////////// @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == PublicIntent.REQUESTCODE_FILEPICKER && data != null && data.getData() != null) { String tmpPath = ActionManager.getPath(getActivity(), data.getData()); if (tmpPath != null) { tmpFile = new File(tmpPath); } else { // Error case : Unable to find the file path associated to user // pick. // Sample : Picasa image case ActionManager.actionDisplayError( ChildrenBrowserFragment.this, new AlfrescoAppException(getString(R.string.error_unknown_filepath), true)); } } }