diff --git a/src/acr/browser/lightning/BookmarkActivity.java b/src/acr/browser/lightning/BookmarkActivity.java index 8b61c12..35fbe1c 100644 --- a/src/acr/browser/lightning/BookmarkActivity.java +++ b/src/acr/browser/lightning/BookmarkActivity.java @@ -67,7 +67,7 @@ public class BookmarkActivity extends ThemableSettingsActivity implements OnClic onCreateDialog(DIALOG_LOAD_FILE); break; case R.id.importFromBrowser: - mBookmarkManager.importBookmarksFromBrowser(); + mBookmarkManager.importBookmarksFromBrowser(BookmarkActivity.this); break; case R.id.exportBackup: mBookmarkManager.exportBookmarks(); @@ -152,7 +152,7 @@ public class BookmarkActivity extends ThemableSettingsActivity implements OnClic builder.setItems(mFileNameList, this); builder.show(); } else { - mBookmarkManager.importBookmarksFromFile(mFileList[which]); + mBookmarkManager.importBookmarksFromFile(mFileList[which], BookmarkActivity.this); } } diff --git a/src/acr/browser/lightning/BookmarkManager.java b/src/acr/browser/lightning/BookmarkManager.java index 417df9b..4442432 100644 --- a/src/acr/browser/lightning/BookmarkManager.java +++ b/src/acr/browser/lightning/BookmarkManager.java @@ -320,7 +320,7 @@ public class BookmarkManager { * This method imports all bookmarks that are included in the device's * permanent bookmark storage */ - public synchronized void importBookmarksFromBrowser() { + public synchronized void importBookmarksFromBrowser(Context context) { if (PreferenceManager.getInstance().getSystemBrowserPresent()) { List bookmarkList = new ArrayList(); @@ -350,7 +350,7 @@ public class BookmarkManager { Utils.showToast(mContext, number + " " + mContext.getResources().getString(R.string.message_import)); } else { - Utils.createInformativeDialog(mContext, + Utils.createInformativeDialog(context, mContext.getResources().getString(R.string.title_error), mContext .getResources().getString(R.string.dialog_import_error)); } @@ -363,7 +363,7 @@ public class BookmarkManager { * @param dir * @param file */ - public synchronized void importBookmarksFromFile(File file) { + public synchronized void importBookmarksFromFile(File file, Context context) { if (file == null) { return; } @@ -388,17 +388,17 @@ public class BookmarkManager { number + " " + mContext.getResources().getString(R.string.message_import)); } catch (FileNotFoundException e) { e.printStackTrace(); - Utils.createInformativeDialog(mContext, + Utils.createInformativeDialog(context, mContext.getResources().getString(R.string.title_error), mContext .getResources().getString(R.string.import_bookmark_error)); } catch (IOException e) { e.printStackTrace(); - Utils.createInformativeDialog(mContext, + Utils.createInformativeDialog(context, mContext.getResources().getString(R.string.title_error), mContext .getResources().getString(R.string.import_bookmark_error)); } catch (JSONException e) { e.printStackTrace(); - Utils.createInformativeDialog(mContext, + Utils.createInformativeDialog(context, mContext.getResources().getString(R.string.title_error), mContext .getResources().getString(R.string.import_bookmark_error)); }