I have a WebView
I'm loading in an activity in order to have it preloaded so that it pops up immediately in a different Activity
(launched from the first).
The problem is that in order to instantiate a WebView
, I have to pass in a Context
, in this case it's the first mentioned above.
So it works great, and the second Activity
shows the WebView
just fine. The problem is that if I click a <select>
dropdown in the WebView
, its selector dialog shows up UNDER the WebView. It feels like the select doesn't work at all until you hit the back button and briefly see the selection dialog just before you return to the parent activity.
It seems as though when I append the WebView
to the layout in the second activity, it's modals get attached to that activity's window, but the WebView
itself is attached to the parent activity's window, so it shows in a higher point in the hierarchy.
How can I possibly change the Context
of the WebView
after it's been instantiated?
This is a very difficult problem to solve -- I have to create the WebViews before the activity is started, but I also need the selection dialogs to work.
Please if anyone can give me some insights here I'd greatly appreciate it.
This is for an SDK project, so I will not have access to the parent activity. Also, saveState isn't working, because the bulk of what is shown in the WebView
is generated by JavaScript, and the full DOM stack doesn't transfer.