LinearLayout height in onCreate is 0

You have to wait until layout happens, which is after onCreate(). You can do so by listening to onSizeChanged() on a View or by posting a Runnable from onCreate() (myView.post(new Runnable() { ... })).

Leave a Comment