Error: "The BookmarkColumns symbol could not be found"

2

I have a project of 3 years ago and I need to make it come back to life, but it is full of complications with updates, I came across an impace that Browser Bookmark Changes was removed.

Does anyone know how I can resolve this?

In this method I'm using the Browser.BookmarkColumns call:

@Override
  protected void onListItemClick(ListView l, View view, int position, long id) {
    Adapter adapter = getListAdapter();
    if (position >= 0 && position < adapter.getCount()) {
      String packageName = ((AppInfo) adapter.getItem(position)).getPackageName();
      Intent intent = new Intent();
      intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
      intent.putExtra(Browser.BookmarkColumns.URL, "market://details?id=" + packageName);
      setResult(RESULT_OK, intent);
    } else {
      setResult(RESULT_CANCELED);      
    }
    finish();
  }

In other places I also call this Browser.BookmarkColumns or Browser.BOOKMARKS_URI

    
asked by anonymous 28.03.2018 / 21:31

1 answer

3

The problem is probably that, with the "updates", compileSdkVersion was declared to version 6.0 or higher.

Version 6.0 removes compatibility with "global favorites".

Extract documentation:

  

This version removes compatibility with global bookmarks. The android.provider.Browser.getAllBookmarks () and android.provider.Browser.saveBookmark () methods were removed. Likewise, the READ_HISTORY_BOOKMARKS and WRITE_HISTORY_BOOKMARKS permissions have been removed. If your app is targeted to Android 6.0 (Level 23 API) or later, do not access global provider bookmarks or add bookmark permissions. Instead, the app should store the bookmarks internally.

Or declare compileSdkVersion=22 or your application will have to save / manage your Bookmarks

    
02.04.2018 / 15:05