What I have observed till now is that background tasks like the following code are executed after the whole
main_activity.java has been run.
First I run this code.
Here I load a URL in the webview, Wait for it to finish loading
Now after clicking the button, the webpage changes (but has the same URL) and gives me another button which I want to press.
So I again do –
But it doesn’t work.
I logged out some random string to check which string is printed first and saw that
string2 is printed first and after that the app tries to load the URL and then
string1 is printed.
I want to click many buttons one after the other and the webview will change it’s HTML in the course.
How can I continue the process of clicking different buttons and not single one.
Basically – webpage loads – I click button – I wait – webpage changes – I click another button and so on…