######################################## #####
This article is original to extreme cold ice, for reprint, please specify the source #################################### #########
I recently made several small feature files on the android browser to share with you. The effect of this feature is that you can choose to save the link on the webpage to the bookmarks after the link is directly pressed. The specific implementation code is:
Diff -- git a/src/com/android/browser/Controller. java B/src/com/android/browser/Controller. javaindex 8341567 .. fd17a6a 100644 --- a/src/com/android/browser/Controller. java ++ B/src/com/android/browser/Controller. java @-481,6 + 481,18 @ public class Controller});} + // feature add by chao + private void bookmarks (String url, String title, String src) + {+ Intent I = new Intent (mActivity, AddBookmarkPa Ge. class); + I. putExtra (BrowserContract. Bookmarks. URL, url); + I. putExtra (BrowserContract. Bookmarks. TITLE, title); + if (I! = Null) + {+ mActivity. startActivity (I); ++} + // end private void startHandler () {mHandler = new Handler () {- 527,6 + 539,11 public class Controller mActivity, url, view. getSettings (). getUserAgentString (), null, view. isPrivateBrowsingEnabled (); break; + // Feature add by chao + case R. id. save_bookmarks_menu_id: + bookmarks (url, title, src); + break; + // end} break;-1850,6 + 1867,7 @ Public class Controller case R. id. open_context_menu_id: case R. id. save_link_context_menu_id: case R. id. copy_link_context_menu_id: + case R. id. save_bookmarks_menu_id: final WebView webView = getCurrentTopWebView (); if (null = webView) {result = false; --- a/res/menu/browsercontext. xml ++ B/res/menu/browsercontext. xml @-42,6 + 42,10 @ android: title = "@ string/contextmenu_Z cursor? Http://www.bkjia.com/kf/ware/vc/ "target =" _ blank "class =" keylink "> vcGVubGlua19uZXd3aW5kb3c ="/>
+
+
+