Search code examples
androidlayout-inflater

Android, is there a onInflated Function?


Hi i have a XML page and a class which is dynamically inflated

public class CmsPage extends LinearLayout

<my.package.CmsPage xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

Now i want that my CmsPage automatically inflates subViews... but in the constructor it is too early. Is there an onCreate function for LinearLayouts ?

I tried with an OnPreDrawListener, but this is to late since i want to fill my member variables in this function, like the onCreate of my activity.


Solution

  • LinearLayout extends View, which has a method called onFinishInflate()