I have an HTML file with button, The button will popup an alert message when we click on to the button.
I placed the HTML file assets folder, Its correctly loading to the emulator and i can see the button but the issue i am facing is, the button click is not responsive, I cant see the popup message.
I also enabled the JavaScript but the result was negative. Then I changed the alert event to the JavaScript code but not worked. Here I am adding my code, I appreciate if anybody can help.
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(com.example.test.R.layout.activity_main);
myWebView= (WebView) findViewById(com.example.test.R.id.webView1);
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.loadUrl("file:///android_asset/myown.html");
}
The following is my HTML page code
<!DOCTYPE html>
<html>
<body>
<button type="button" onclick="alert('Hello world!')">Click Me!</button>
</body>
</html>