I am new in android development. I have a case in which I have loaded a website in android webview. There are some print links in the website. When the links are clicked, it will do an ajax post and the ajax response(html formatted data) will be populated in a new print window, from where we can print the data. Now the issue is this is not working in android webview. Is there any solution so that I can make this work in android?
Below is the javascript function which is called to print the data in the website.
function printBill(data)
{
var mywindow = window.open('', 'kada bill', 'height=400,width=600');
mywindow.document.write('<html><head><title></title>');
/*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
mywindow.document.write('</head><body >');
mywindow.document.write(data);
mywindow.document.write('</body></html>');
mywindow.document.close(); // necessary for IE >= 10
mywindow.focus(); // necessary for IE >= 10
mywindow.print();
mywindow.close();
return true;
}