My application has a view that is programmatically added to the activity using this code:
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(480, 75); RelativeLayout parent = (RelativeLayout)mMyView.getParent(); if (parent != null) { parent.removeView(mMyView); } activity.addContentView(mMyView, layoutParams);`
After clicking the "Back" button, which, in turn, calls OnDestroy () and starts the application again, I donβt see the View drawing on the screen, and I get this warning in DDMS when it tries to draw it:
WARN / webcore (5336): cannot get viewWidth after first layout
It should be noted that the presentation operates in this state (page resources are loaded in accordance with the DDMS protocol)
Other "normal" views (ImageView, TextView), which are also in the same ContentView, are beautifully drawn.
Any ideas how I can solve this problem, or what could be its source?
source share