// Check that the bookmark exists
try {
FileSystemObject fso = CommandHelper.getFileInfo(this, path, null);
- intent.putExtra(NavigationActivity.EXTRA_BOOKMARK_SELECTION, fso);
- setResult(RESULT_OK, intent);
+ if (fso != null) {
+ intent.putExtra(NavigationActivity.EXTRA_BOOKMARK_SELECTION, fso);
+ setResult(RESULT_OK, intent);
+ } else {
+ // The bookmark not exists, delete the user-defined bookmark
+ try {
+ Bookmark b = Bookmarks.getBookmark(getContentResolver(), path);
+ Bookmarks.removeBookmark(this, b);
+ refresh();
+ } catch (Exception ex) {/**NON BLOCK**/}
+ }
} catch (Exception e) {
// Capture the exception
ExceptionUtil.translateException(this, e);
String path = ((NavigationViewInfoParcelable)h.getItem()).getCurrentDir();
try {
- CommandHelper.getFileInfo(this, path, null);
- break;
+ FileSystemObject info = CommandHelper.getFileInfo(this, path, null);
+ if (info != null) {
+ break;
+ }
+ this.mHistory.remove(this.mHistory.size() - 1);
} catch (Exception e) {
ExceptionUtil.translateException(this, e, true, false);
this.mHistory.remove(this.mHistory.size() - 1);
// Check that the bookmark exists
try {
FileSystemObject fso = CommandHelper.getFileInfo(this, item.getFullPath(), null);
- if (FileHelper.isDirectory(fso)) {
- intent.putExtra(NavigationActivity.EXTRA_SEARCH_ENTRY_SELECTION, fso);
- intent.putExtra(
- NavigationActivity.EXTRA_SEARCH_LAST_SEARCH_DATA,
- (Parcelable)createSearchInfo());
- setResult(RESULT_OK, intent);
+ if (fso != null) {
+ if (FileHelper.isDirectory(fso)) {
+ intent.putExtra(NavigationActivity.EXTRA_SEARCH_ENTRY_SELECTION, fso);
+ intent.putExtra(
+ NavigationActivity.EXTRA_SEARCH_LAST_SEARCH_DATA,
+ (Parcelable)createSearchInfo());
+ setResult(RESULT_OK, intent);
+ } else {
+ // Open the file here, so when focus back to the app, the search activity
+ // its in top of the stack
+ ActionsPolicy.openFileSystemObject(this, fso, false);
+ return;
+ }
} else {
- // Open the file here, so when focus back to the app, the search activity
- // its in top of the stack
- ActionsPolicy.openFileSystemObject(this, fso, false);
- return;
+ // The fso not exists, delete the fso from the search
+ try {
+ removeItem(item);
+ } catch (Exception ex) {/**NON BLOCK**/}
}
} catch (Exception e) {
*/
@MediumTest
public void testListInfo() throws Exception {
- FileSystemObject file = CommandHelper.getFileInfo(getContext(), LS_INFOFILE, getConsole());
+ FileSystemObject file =
+ CommandHelper.getFileInfo(getContext(), LS_INFOFILE, getConsole());
assertNotNull("file==null", file); //$NON-NLS-1$
assertTrue(
String.format("file!=%s", LS_INFOFILE_NAME), //$NON-NLS-1$