title: Android - check if layout exists
body: <p>Is there any way I can check if a certain layout ID exists before using it with setContentView(R.layout.mylayoutid)?</p>
  
  <p>Something like:</p>
  
  <pre><code>if(layout_exists("mylayoutid"))
      setContentView(R.layout.mylayoutid);
  else
      setContentView(R.layout.defaultlayout);
  </code></pre>
  
  <p>couldn't find anything in the developer docs.</p>
  
  <p>Thanks!</p>