Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7740219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:43:18+00:00 2026-06-01T08:43:18+00:00

Many mobile web browsers have some default functionality on image hold. For example, user

  • 0

Many mobile web browsers have some default functionality on image hold. For example, user is shown an option to save or copy or move to link option, if he holds a image on a browser.

Can the same functionality be replicated in android app using a webview? Is there some default settings available or do I need to code for such functionality?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:43:19+00:00Added an answer on June 1, 2026 at 8:43 am

    I am not able to find a perfect solution yet, but this might do the trick.

    In onCreate():

    registerForContextMenu(mWebView);
    

    And override the onCreateContextMenu() method:

    @Override  
    public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) {  
        super.onCreateContextMenu(menu, v, menuInfo);  
    
        HitTestResult result = ((WebView) v).getHitTestResult();
    
        MenuItem.OnMenuItemClickListener handler = new MenuItem.OnMenuItemClickListener() {
            public boolean onMenuItemClick(MenuItem item) {
                // do the menu action
                return true;
            }
        };
    
        if (result.getType() == HitTestResult.IMAGE_TYPE ||
                result.getType() == HitTestResult.SRC_IMAGE_ANCHOR_TYPE) {
            // Menu options for an image.
            //set the header title to the image url
            menu.setHeaderTitle(result.getExtra());
            menu.add(0, 1, 0, "Save Image").setOnMenuItemClickListener(handler);
            menu.add(0, 2, 0, "View Image").setOnMenuItemClickListener(handler);
        } 
    }  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am an iPhone developer. I create many mobile applications. Some of them need
Say I have a mobile web app written using JQuery Mobile, this app retrieves
I have implemented web service using rails server. The server uses rails default authentication
We have a mobile web site that requires users to enter a specific time
There are many great solutions for mobile detection out on the web such as
Predictive typing is a handy feature on many mobile phones. How would/can you implement
I've got a jquery-mobile app with two real html pages, but many more data-role=page
Many times I have seen Visual Studio solutions which have multiple projects that share
Many applications have grids that display data from a database table one page at
Many of us have used Perfmon tool to do performance analysis. Especially with .Net

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.