Fix RuntimeException on Android M Preview
This commit is contained in:
parent
29d2a5f3e5
commit
5081ee2ea6
@ -1859,7 +1859,8 @@ public abstract class BrowserActivity extends ThemableActivity implements Browse
|
||||
if (isSystemBrowserAvailable() && mPreferences.getSyncHistoryEnabled()) {
|
||||
try {
|
||||
Browser.updateVisitedHistory(getContentResolver(), url, true);
|
||||
} catch (NullPointerException ignored) {
|
||||
} catch (Exception ignored) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
try {
|
||||
@ -1890,10 +1891,9 @@ public abstract class BrowserActivity extends ThemableActivity implements Browse
|
||||
String[] columns = new String[]{"url", "title"};
|
||||
boolean browserFlag;
|
||||
try {
|
||||
|
||||
Uri bookmarks = Browser.BOOKMARKS_URI;
|
||||
c = getContentResolver().query(bookmarks, columns, null, null, null);
|
||||
} catch (SQLiteException | IllegalStateException | NullPointerException e) {
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -399,7 +399,7 @@ public class BookmarkManager {
|
||||
* This method imports all bookmarks that are included in the device's
|
||||
* permanent bookmark storage
|
||||
*/
|
||||
public synchronized void importBookmarksFromBrowser(Activity activity) {
|
||||
public synchronized void importBookmarksFromBrowser(Activity activity) throws Exception{
|
||||
if (PreferenceManager.getInstance().getSystemBrowserPresent()) {
|
||||
|
||||
List<HistoryItem> bookmarkList = new ArrayList<>();
|
||||
|
@ -74,7 +74,11 @@ public class BookmarkSettingsFragment extends PreferenceFragment implements Pref
|
||||
createDialog();
|
||||
return true;
|
||||
case SETTINGS_BROWSER_IMPORT:
|
||||
try {
|
||||
mBookmarkManager.importBookmarksFromBrowser(getActivity());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
@ -44,7 +44,7 @@ public class WebUtils {
|
||||
if (systemBrowserPresent) {
|
||||
try {
|
||||
Browser.clearHistory(context.getContentResolver());
|
||||
} catch (NullPointerException ignored) {
|
||||
} catch (Exception ignored) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user