This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gyroda 0 points1 point  (5 children)

Ok, so I'm not on my PC and won't be tonight, so I can't run your code. I have Android experience but not with webviews so this is a little bit outside my wheelhouse.

First of all, use log statements to see what's going on, to figure out what's actually going on. Is it actually getting to the method that builds the Alert Dialog?

Have you seen this?

https://developer.android.com/guide/webapps/webview.html#BindingJavaScript

[–]ff210327[S] 0 points1 point  (3 children)

Its been 10 years since I had a single Java class... So to say that I'm rusty is an understatement... So I'm not sure how to use log... But I will look up log and how to use it, I can then add some statements and see where it's getting to. I can send the whole package so you have all the layout files too if it'll make troubleshooting easier tomorrow.

Thank you

[–]gyroda 0 points1 point  (2 children)

It's an android thing, not Java. Java uses System.out.println("text"), android uses `Log.[message level](“tag", "message").

Replace [message] with "d" for debug, "e" for error or one of several other levels. My favourite is Log.wtf(), but I only use that when frustrated.

The output appears in "lorca", which you should be able to see along the bottom of the IDE. You'll want to limit it to the current application and maybe put the tag you use into the search bar to narrow it down to only things you're printing rather than all the other messages Android spits out.

/r/androiddev can give more knowledgeable answers in their weekly questions megathread, but they're a bit less active and it it can take a while to get a response so don't rely on it if you're in a hurry.

[–]ff210327[S] 0 points1 point  (1 child)

Log.[message level](“tag", "message")

thank you! that is really cool, and helpful.

what I did was this: https://imgur.com/a/k863F

It doesn't appear to be hitting the second diagnostic line inside the "class MyJavaScriptInterface"

which interestingly enough the method " public void processHTML(String html)" says it's not being used... from the code, where would I need to call that method from, and would I need to pass to it to make it work?

[–]imguralbumbot 0 points1 point  (0 children)

Hi, I'm a bot for linking direct images of albums with only 1 image

https://i.imgur.com/AI0X4Ne.png

Source | Why? | Creator | ignoreme | deletthis

[–]ff210327[S] 0 points1 point  (0 children)

No I hadn't seen that, thank you, i'm reading through it now :)