title: How to inflate layout in EditMode?
body: <p>I have a simple custom View which just extends LinearLayout and use simple XML layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:gravity="center_horizontal"
      android:orientation="horizontal" &gt;
  
      &lt;ImageView
          android:id="@+id/iv1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:src="@drawable/ic_image1" /&gt;
  
      &lt;TextView
          android:id="@+id/tv1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/text1"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
      &lt;TextView
          android:id="@+id/tv2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="@string/text2"
          android:textAppearance="?android:attr/textAppearanceLarge" /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And Java-code:</p>
  
  <pre><code>public class MyCustomView extends LinearLayout {
  
      public MyCustomView(Context context) {
          super(context);
          init(context);
      }
  
      public MyCustomView(Context context, AttributeSet attrs) {
          super(context, attrs);
          init(context);
      }
  
      @SuppressLint("NewApi")
      public MyCustomView(Context context, AttributeSet attrs, int defStyleAttr) {
          super(context, attrs, defStyleAttr);
          init(context);
      }
  
      private void init(Context context) {
          if (isInEditMode()) {
              // How to inflate R.layout.my_custom_view here?
          } else {
              LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              inflater.inflate(R.layout.my_custom_view, this, true);
          }
      }
  
  }
  </code></pre>
  
  <p>I want that my custom view will showing in Eclipse layout editor as a default layout (R.layout.my_custom_view). But it cannot inflate and show exception:</p>
  
  <pre><code>android.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F03000B.
      at android.content.res.BridgeResources.throwException(BridgeResources.java:693)
      at android.content.res.BridgeResources.getLayout(BridgeResources.java:271)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:395)
      at ru.bartwell.myapp.MyCustomView.init(MyCustomView.java:29)
      at ru.bartwell.myapp.MyCustomView.&lt;init&gt;(MyCustomView.java:18)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(    at sun.reflect.NativeConstructorAccessorImpl.newInstance(    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(    at java.lang.reflect.Constructor.newInstance(    at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:422)
      at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:179)
      at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
      at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
      at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:755)
      at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
      at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:758)
      at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
      at android.view.LayoutInflater.rInflate(LayoutInflater.java:727)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
      at android.view.LayoutInflater.inflate(LayoutInflater.java:373)
  </code></pre>
  
  <p>Is there way to inflate default layout in EditMode?</p>