As parameter step in html to load in android Webview

Asked

Viewed 344 times

0

I need to pass parameters in the "image" and "embed" tags to load into a webView, but the parameters should be from the Android Assets folder

int height = PKViewSize.getHeightOfDisplay(context);
int width  = PKViewSize.getWidthOfDisplay(context);

String html = "<html>"
                + "<head>"
                    + "<meta charset=\"UTF-8\"> <title></title>"
                + "</head>"
                + "<body bgcolor=\"#000000\"> "
                    + "<img src=\"Galeria_Menu5-Img_2.png\">"
                    + "<center>"
                        + "<article> "
                            + "<param name=wmode value=transparent>"
                            + "<embed src=\"1.swf \" height=\" +" + height + "+ \"  width=\"+" + width + "+\" wmode=transparent "
                            + "type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> "
                        + "</article>"
                    + "</center>"
                + "</body>"
            + "</html>";

webView.loadData(html, "text/html", "UTF-8");

1 answer

0


I got...

String html = "<html>"
            + "<head>"
                + "<meta charset=\"UTF-8\"> <title></title>"
            + "</head>"
            "<body bgcolor=\"#000000\"> "
                        + "<img src=\"file:///android_asset/" + filename +"\">"

                    + "</body>"
        + "</html>";

Browser other questions tagged

You are not signed in. Login or sign up in order to post.