title: findViewById returns null in custom View after inflate
body: <p>I have a custom <code>RelativeLayout</code> and I inflate an xml res file in it. 
  This works fine if I use the custom layout in an xml file and set it as contentview, but if I try to add it in the code with <code>new LocationItem(this)</code> and <code>addChild()</code> the <code>findViewById</code> method always returns <code>null</code> in the constructor of the custom <code>RelativeLayout</code>.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>public class LocationItem extends RelativeLayout {
  
  private String parcelType;
  private int countIntoBox, countFromBox;
  
  private RelativeLayout deliveryContainer, pickupContainer;
  
  private TextView countPickup, countDelivery;
  
  public LocationItem(Context context) {
      this(context, null);
  }
  
  public LocationItem(Context context, AttributeSet attrs) {
      this(context, attrs, 0);
  }
  
  public LocationItem(Context context, AttributeSet attrs, int defStyle) {
      super(context, attrs, defStyle);
      inflate(getContext(), R.layout.list_item_location, this);
      deliveryContainer = (RelativeLayout) findViewById(R.id.rl_location_delivery_container);
      pickupContainer = (RelativeLayout) findViewById(R.id.rl_location_pickup_container);
      countPickup = (TextView) findViewById(R.id.tv_location_pickup_count);
      countDelivery = (TextView) findViewById(R.id.tv_location_delivery_count);
  
      countPickup.setOnClickListener(getShowNumberPickerListener());
      countDelivery.setOnClickListener(getShowNumberPickerListener());
  }
  
  private OnClickListener getShowNumberPickerListener() {
      return new OnClickListener() {
          @Override
          public void onClick(View view) {
              showNumberPickerDialog(view);
          }
      };
  } ...
  }
  </code></pre>
  
  <p>Add custom view in activity </p>
  
  <pre><code>mRootLayoutLocations.addView(new LocationItem(this));
  </code></pre>
  
  <p>The view is inflated correctly, because I can see it, but when I try to access a view inside the custom view the app crashes with a NullPointerException. </p>