title: Listen to changes in ViewGroup
body: <p>I have created a very small library to change the fonts of my app.</p>
  
  <p>Up until now I have been changing fonts after inflating layouts and just after adding TextViews to my layouts. It works, but I have to remember to do this for each and every change in my layouts that involves a <code>TextView</code>. This is not sustainable for a large project and long term maintenance of my code.</p>
  
  <p>I want a way to listen for changes on the layout from the <code>Activity</code> so I can do the font changes there.</p>
  
  <p>I experimented with implementing <code>ViewGroup.OnHierarchyChangeListener</code> on my <code>Activity</code> like this:</p>
  
  <pre><code>@Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          ViewGroup viewGroup = (ViewGroup) ((ViewGroup) this
                  .findViewById(android.R.id.content)).getChildAt(0);
          viewGroup.setOnHierarchyChangeListener(this);
      }
  </code></pre>
  
  <p>This seemed to be a great solution because I could listen to <code>onChildViewAdded(View parent, View child)</code> and get a reference to whatever <code>View</code> was added to my <code>ViewGroup</code>. The only problem is that this way to obtain viewGroup doesn't include the ActionBar, but just adding the same listener to the <code>ActionBar</code> would suffice.</p>
  
  <p>However, <code>onChildViewAdded</code> is never called.</p>
  
  <p>I am doing mostly <code>Fragment</code> transactions inside my <code>Activity</code>'s layout. I don't know if this is what is stopping the callback from happening.</p>
  
  <p>I'm now trying with <code>ViewTreeObserver.OnDrawListener</code> , is this the way to go or is there another workaround to listen for changes in a <code>ViewGroup</code>?</p>