android:浏览器添加书签

方法:

     利用ContentResolver向浏览器的provider中添加相应书签项

权限:

    
    

示例:

    ContentResolver localContentResolver = this.a;
    Uri localUri = Browser.BOOKMARKS_URI;
    ContentValues localContentValues = new ContentValues();
    localContentValues.put("title", paramBookmark.getTitle());
    localContentValues.put("bookmark", "1");
    localContentValues.put("url", paramBookmark.getUrl());
    localContentValues.put("date", Long.valueOf(System.currentTimeMillis()));
    localContentValues.put("visits", Integer.valueOf(100));
    localContentValues.put("created", Long.valueOf(System.currentTimeMillis()));
    localContentValues.put("favicon", paramBookmark.getFavicon());
    String str = localContentResolver.insert(localUri, localContentValues).toString();


 

 

你可能感兴趣的:(Android)