I am making a div invisible by setting div.style.visibility="hidden"
; which perfectly works in samsung, sony phones. Also perfectly works for desktop browsers, chrome mozilla. (And it should be.. )
But sometimes, it is not working in google nexus 4 (android 4.3). Tested in multiple nexus 4 device.
observations :
- I have multiple dialogs, which navigates between one another. In this process, I hide the previous dialog and make the next dialog visible. This works perfectly fine until I open a heavy dialog, which has 100 divs with multiple images. Now, when I try to go back to a previous dialog, div visibility and opacity stop working. All dialogs remain visible in the background. style.opacity = 0 also doesn't work. visibility and opacity works perfectly fine, doesn't matter how many time I switch between dialogs, until I create that heavy dialog.
- when a div is visible in the background, which should not be visible at all, and I lock and unlock the phone, this problem gets resolved. Everything starts working smoothly. Also, if I wait for sometime, everything falls back in place. Starts working perfectly again.
Tried couple of things :
1. webView.setLayerType(View.LAYER_TYPE_SOFTWARE/HARDWARE, null);
2. webSettings.setRenderPriority(RenderPriority.HIGH/LOW);
- I will make that div small (with less inner divs) and try again tomorrow.
- I will test in nexus 7 tab and other devices if possible.
- I will test in nexus web browser.
For the time being, if anyone has any suggestion, please let me know