title: FrameLayout not displaying elements
body: <p>I am trying to create a <em>FrameLayout</em> that contains other <em>FrameLayouts</em>. I have created an EditorView class that extends FrameLayout, and I want it to display <em>FileView</em>, another class that extends <em>FrameLayout</em>. But in Android Studio preview I get an blank view. What am I doing wrong.</p>
  <p>This is the ediorview_activity.xml:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;&gt;
  
      &lt;com.itsvaske.webio.Views.LineView
          android:id=&quot;@+id/html1&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot; /&gt;
  
      &lt;com.itsvaske.webio.Views.LineView
          android:id=&quot;@+id/html2&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_below=&quot;@id/html1&quot; /&gt;
  
      &lt;com.itsvaske.webio.Views.LineView
          android:id=&quot;@+id/html3&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_below=&quot;@id/html2&quot; /&gt;
  
      &lt;com.itsvaske.webio.Views.LineView
          android:id=&quot;@+id/html4&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_below=&quot;@id/html3&quot; /&gt;
  
      &lt;com.itsvaske.webio.Views.LineView
          android:id=&quot;@+id/html5&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_below=&quot;@id/html4&quot; /&gt;
  
      &lt;com.itsvaske.webio.Views.LineView
          android:id=&quot;@+id/html6&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_below=&quot;@id/html5&quot; /&gt;
  
      &lt;com.itsvaske.webio.Views.LineView
          android:id=&quot;@+id/html7&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_below=&quot;@id/html6&quot; /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  <p>This is lineview_layout.xml:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;&gt;
  
      &lt;TextView
          android:id=&quot;@+id/lineNumber&quot;
          android:layout_width=&quot;30dp&quot;
          android:layout_height=&quot;40dp&quot;
          android:layout_weight=&quot;0&quot;
          android:gravity=&quot;center&quot;
          android:text=&quot;1&quot;
          android:textColor=&quot;#000000&quot;
          android:textSize=&quot;20sp&quot; /&gt;
  
      &lt;EditText
          android:id=&quot;@+id/line&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;42dp&quot;
          android:layout_weight=&quot;3&quot;
          android:background=&quot;@null&quot;
          android:ems=&quot;10&quot;
          android:hint=&quot;@string/typeyourline&quot;
          android:inputType=&quot;textPersonName&quot;
          android:minHeight=&quot;32dp&quot;
          android:textColorHint=&quot;#546E7A&quot; /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>This is EditorView class:</p>
  <pre><code>public class EditorView extends FrameLayout {
  
      private Context mContext;
      private AttributeSet mAttributeSet;
  
      public EditorView(@NonNull Context context, @Nullable AttributeSet attrs) {
          super(context, attrs);
          this.mContext = context;
          this.mAttributeSet = attrs;
          initView();
      }
  
      private void initView() {
          View view = View.inflate(mContext, R.layout.editor_start_html_layout, this);
          LineView line1 = view.findViewById(R.id.html1);
          LineView line2 = view.findViewById(R.id.html2);
          LineView line3 = view.findViewById(R.id.html3);
          LineView line4 = view.findViewById(R.id.html4);
          LineView line5 = view.findViewById(R.id.html5);
          LineView line6 = view.findViewById(R.id.html6);
          LineView line7 = view.findViewById(R.id.html7);
          line1.setLineNumber(1);
          line1.setLineContents(&quot;&lt;html&gt;&quot;);
          line2.setLineNumber(2);
          line2.setLineContents(&quot;&lt;head&gt;&quot;);
          line3.setLineNumber(3);
          line3.setLineContents(&quot;    &lt;title&gt;&lt;/title&gt;&quot;);
          line4.setLineNumber(4);
          line4.setLineContents(&quot;&lt;/head&gt;&quot;);
          line5.setLineNumber(5);
          line5.setLineContents(&quot;&lt;body&gt;&quot;);
          line6.setLineNumber(6);
          line6.setLineContents(&quot;&lt;/body&gt;&quot;);
          line7.setLineNumber(7);
          line7.setLineContents(&quot;&lt;/html&gt;&quot;);
      }
  }
  </code></pre>
  <p>And In preview I get this:
  <a href="https://i.stack.imgur.com/vdMZo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vdMZo.png" alt="enter image description here" /></a></p>