Several small feature (1) links in android browser to save bookmarks

Source: Internet
Author: User

######################################## #####

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 ="/>
 +
 +
 +
          
      

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.