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 7197021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:53:25+00:00 2026-05-28T20:53:25+00:00

On Android, I’m am using a webview to display a chart designed by the

  • 0

On Android, I’m am using a webview to display a chart designed by the API flot.

I’m using this code:

    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.graphique);

    // Get a reference to the declared WebView holder
    WebView webview = (WebView) this.findViewById(R.id.webView1);

    // Get the settings
    WebSettings webSettings = webview.getSettings();

    // Enable Javascript for interaction
    webSettings.setJavaScriptEnabled(true);

    // Make the zoom controls visible
    //webSettings.setBuiltInZoomControls(true);

    // Allow for touching selecting/deselecting data series
    webview.requestFocusFromTouch();

    // Set the client
    webview.setWebViewClient(new WebViewClient());
    webview.setWebChromeClient(new WebChromeClient());
    webview.setBackgroundColor(0);

    webview.getSettings().setLoadWithOverviewMode(true);
    webview.getSettings().setUseWideViewPort(true);
    // Load the URL
    webview.loadUrl("file:///android_asset/graph.html");

The graph is displayed correctly and fills the entire webview even if the width and height are not the same at start (thanks to setLoadWithOverviewMode(true) and setUseWideViewPort(true)).

But the user can still zoom and unzoom the graph by double tapping on it.

I want to prevent this action, I tried to put my webview to clickable=false, focusable=false and focusableintouchmode=false but it doesn’t work.

I tried this also :

webview.getSettings().setBuiltInZoomControls(false);

But it doesn’t work. Do you have any clue ?

  • 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-28T20:53:27+00:00Added an answer on May 28, 2026 at 8:53 pm

    try to set

    webView.getSettings().setUseWideViewPort(false);
    

    and deal with scale manually to fit the width..

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

Sidebar

Related Questions

Android allows content of a URL to be displayed within an application using WebView
Android: I am using following code to insert image into album According to description
[Android Newbie alert] I need to capture the contents of a WebView in a
Android Code Style Guide defines Android Code Style Rules. To conform to these rules
Android will call onCreate() of my activity whenever it is launched. In the onCreate()
Android APK-Files are not binaries but byte-code-files. So is it possible to install the
Android SDK since release of API v. 11 contains XmlAdapter sample which is also
Android SDK Manager complains WARNING: Java not found in your path. Instead of using
android.text.format.DateFormat specifies that using the format string 'a' should yield 'a' or 'p' and
android.database.sqlite.SQLiteConstraintException: error code 19: constraint failed error in my application and not sure why.

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.