My layout sometimes doesn't position elements correctly. I tried many solutions, but a unique working one - it turns from portrait to landscape, and then returns from landscape to portrait. Then the layout is automatically redrawn and perfect. I set the keyboard orientation, so the content does not restart, it just redraws. How to redraw content programmatically, for example, landscape portrait? Thank.
EDIT: I tried to follow and has no effect
getWindow().getDecorView().findViewById(android.R.id.content).invalidate();
getWindow().getDecorView().findViewById(android.R.id.content).requestLayout();
Activity set the main layout to onCreate setContentView(R.layout.main);
The "main" layout contains TabHost and Admob. The layout "view" contains a web view ("id: myWebview"), which is displayed on tab 1.
And also tried to annul them! web browsing, main layout and layout and crashes
Jaume source
share