Error: "Could not find Bookmarkcolumns symbol"

Asked

Viewed 69 times

2

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

Does anyone know how I can fix this?

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

@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();
  }

Elsewhere I also make the call of that Browser.BookmarkColumns or of Browser.BOOKMARKS_URI

1 answer

3


The problem is probably that with the "updates", the compileSdkVersion for version 6.0 or later.

Version 6.0 removes compatibility with "global bookmarks".

Document extract:

This version removes compatibility with global bookmarks. The android.provider.Browser.getAllBookmarks() and android.provider.Browser.saveBookmark() methods have been removed. Similarly, the permissions READ_HISTORY_BOOKMARKS and WRITE_HISTORY_BOOKMARKS have been removed. If the app is facing Android 6.0 (Level 23 API) or later, do not access the global provider’s tags or use bookmark add permissions. Instead, the application should store the bookmarks internally.

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

  • Is there any example of how I would have to change my code where I am trying to save the bookmarks with Bookmarks to do this local?

  • 1

    You will eventually need to use Sqlite. There are many examples of how to use it, just search.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.