Code Monkey home page Code Monkey logo

Comments (5)

xiaojidonggong avatar xiaojidonggong commented on May 19, 2024

webview callback this method onPageError(int errorCode, String description, String failingUrl)

the failingUrl is custom://showImage?image=http://www.pic.com/pic1.jpeg&image=http://www.pic1.com/pic2.jpeg

but i how can i tell the webview i had handled this url ???

from android-advancedwebview.

ocram avatar ocram commented on May 19, 2024

Thanks for your feedback!

Can you please log the values for all three of errorCode, description and failingUrl from onPageError? Thanks!

Why do you need the custom URL scheme at all? How do you load the page? How does the app transition to the gallery app? Can you show some more code excerpts?

Apart from that, can you please try if your custom URLs work with the original WebView from the Android SDK instead of the enhanced version from this library?

from android-advancedwebview.

xiaojidonggong avatar xiaojidonggong commented on May 19, 2024

@mwaclawek Helllo,man~ Thanks for your help
The issue have already been solved. i use the original WebView,the code
`
@OverRide
public boolean shouldOverrideUrlLoading(WebView view, final String url) {

        if (url.startsWith("custom://")) {
            // This is my web site, so do not override; let my WebView load the page
            if(mAdvanceListener!=null){
                mAdvanceListener.onExternalPageRequest(url);
            }
            if(mWebView!=null){
                mWebView.stopLoading();
            }
            return false;
        }else{
            view.loadUrl(url);
            return true;
        }
        //  return super.shouldOverrideUrlLoading(view, url);
    }`

*why do you need the custom URL scheme at all? *
Because Server has a communicate protocol with Client

How do you load the page?
Please see the code

How does the app transition to the gallery app?
I am sorry that I didn't say it clearly. When the user clicks on the picture on the HTML,WebView will call the method "shouldOverrideUrlLoading(WebView view, final String ur)" the url like custom://showImage?image=http://www.pic.com/pic1.jpeg&image=http://www.pic1.com/pic2.jpeg
I analysis the url ,get the image's address and show in GalleryActivity(For browsing pictures)

from android-advancedwebview.

ocram avatar ocram commented on May 19, 2024

@tikkat3 Thanks for letting us now!

The issue have already been solved. i use the original WebView

Glad that it's working now. But does it work with this library, i.e. the AdvancedWebView class, or only with the original WebView class? Which component do you have in your layout?

from android-advancedwebview.

xiaojidonggong avatar xiaojidonggong commented on May 19, 2024

@mwaclawek use original WebView class , I suggest that ,AdvancedWebView add a method addScheme(String scheme) to handle custom url . We know that the structure of URI is scheme://host:port/path Thank you once again

from android-advancedwebview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.