title: findViewById() not finding custom view but it exists in layout
body: <p>Somehow my acitivity_main.xml has the view BottomSelectElement (custom view) but I cannot find it in the activity, but I can find anything else.</p>
  
  <p>activity_main.xml (removed unnecessary parts)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/main_content"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      tools:context="it.bachmann.studytimer.ui.MainActivity"&gt;
  
      &lt;!-- THIS IS THE VIEW I CANNOT FIND IN THE MainActivity.java (BottomSelectElement) --&gt;
      &lt;it.bachmann.studytimer.ui.elements.BottomSelectElement
          android:id="@+id/customBottomSelect"
          android:layout_width="match_parent"
          android:layout_height="48dp"
          android:layout_gravity="bottom|center" /&gt;
  
      &lt;com.github.clans.fab.FloatingActionMenu
  
  &lt;/android.support.design.widget.CoordinatorLayout&gt;
  </code></pre>
  
  <p>my custom view class which is shown perfectly in the activity_main.xml</p>
  
  <pre><code>public class BottomSelectElement extends ConstraintLayout {
  
      private Spinner spinner;
  
      public BottomSelectElement(Context context) {
          super(context);
  
              init();
          }
  
          public BottomSelectElement(Context context, AttributeSet attributeSet) {
              super(context);
              init();
          }
  
          private void init() {
              inflate(getContext(), R.layout.bottom_select_element, this);
              spinner = findViewById(R.id.spinner);
              List&lt;String&gt; categories = Arrays.asList("foo", "bar", "baz");
              ArrayAdapter adapter = new ArrayAdapter&lt;&gt;(getContext(), R.layout.spinner_text, categories);
              adapter.setDropDownViewResource(R.layout.spinner_text_checked);
              spinner.setAdapter(adapter);
          }
  
          public Spinner getSpinner() {
              return spinner;
          }
      }
  </code></pre>
  
  <p>and finally my MainActivity.java which doesn't find the <em>customBottomSelect</em>, but it finds anything else.</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      private final String TAG = this.getClass().getSimpleName();
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Toolbar toolbar = findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
      }
  
      @Override
      protected void onStart() {
          super.onStart();
          BottomSelectElement bottomSelectElement = findViewById(R.id.customBottomSelect);
          Log.d(TAG, "onStart: bottomSelectElement " + bottomSelectElement); // this returns null, althought it should exist!
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          getMenuInflater().inflate(R.menu.menu_main, menu);
          return super.onCreateOptionsMenu(menu);
      }
  }
  </code></pre>
  
  <p>I restarted Android Studio several times, rebuilt and cleaned it. It just doesn't seem to find this id.</p>