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

  • SEARCH
  • Home
  • 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 7635191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:22:40+00:00 2026-05-31T07:22:40+00:00

if webview html content has few <img> tags, is it possible to opens that

  • 0

if webview html content has few <img> tags, is it possible to opens that image in fullscreen mode in new activity when user hit image in webview?

  • 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-05-31T07:22:41+00:00Added an answer on May 31, 2026 at 7:22 am

    Yes it is. basically it is possible to invoke any kind of native Android code from within a WebView. You define the methods you want to expose for calling from within the WebView in a class, pass an instance of this class to the WebView and from then on the methods are invocable just like javascript methods. here comes the example (this is copy-pasted form another answer of mine; you will need to replace the video intent with image displaying intent):

    Calling native code from within web view:
    When creating the web view add javascript interface (basically java class whose methods will be exposed to be called via javascript in the web view).

    JavaScriptInterface jsInterface = new JavaScriptInterface(this);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.addJavascriptInterface(jsInterface, "JSInterface");
    

    The definition of the javascript interface class itself (this is examplary class I took from another answer of mine and opens video in native intent)

    public class JavaScriptInterface {
        private Activity activity;
    
        public JavaScriptInterface(Activity activiy) {
            this.activity = activiy;
        }
    
        public void startVideo(String videoAddress){
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setDataAndType(Uri.parse(videoAddress), "video/3gpp"); // The Mime type can actually be determined from the file
            activity.startActivity(intent);
        }
    }
    

    Now if yo want to call this code form the html of the page you provide the following method:

    <script>
      function playVideo(video){
        window.JSInterface.startVideo(video);
      }
    </script>
    

    So you need to add the appropriate method to JSInterface and call the code from within the Web App.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have various pieces of generated HTML/JS that I load into Activity with WebView#loadDataWithBaseURL.
I want to have a webview that has a single HTML and a single
My application have a WebView. The WebView HTML has: <video id=player src=rtsp://somesite/videofile.mp4 >Video content</video>
When using the WebEngine and WebView of JavaFX 2.0 to show some HTML content,
A Webview will display links in the content HTML as having blue underlines. So
my html file loaded in webView but still without font my font has Unicode
I have a webview that's supposed to show cyrillic text wv.loadData( myStringHtml, html/text, utf-8);
I've got a native Android app that contains a WebView. All my HTML, js
My Android app has a main WebView (HTML loaded from a local resource) which
I use loadData method to load some html content into a webview, but when

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.