title: display an Android LinearLayout in a Codename One application
body: <p>Can I create a LinearLayout (for example) with native android code and display it on a CN1 interface ?</p>
  <p>I have a method that implements native android code to create this view. if the method returns an EditText or Button for example, all works fine. but if it returns a LinearLayout, nothing happens and I have no error message.</p>
  <p>signature of the method that calls on the native code:</p>
  <pre><code>public interface NativeCall extends NativeInterface {
      
      public PeerComponent getMainView();
      
  }
  </code></pre>
  <p>native implementation code that works well:</p>
  <pre><code>    public class NativeCallImpl {
  
          public android.view.View getMainView() {
      
              Button b0 = new Button(((Context) MyApplication.getContext()));                        
              return b0;
          }
      
          public boolean isSupported() {
              return true;
          }
  
  }
  </code></pre>
  <p>native code implementation which does not work:</p>
  <pre><code>public class NativeCallImpl {
         
      public android.view.View getMainView() {
  
          Button b0 = new Button(((Context) MyApplication.getContext()));
          Button b1 = new Button(((Context) MyApplication.getContext()));
  
          b0.setText(&quot;b0&quot;);
          b1.setText(&quot;b1&quot;);
  
          LinearLayout linearLayout = new LinearLayout(((Context) MyApplication.getContext()));
          linearLayout.setOrientation(LinearLayout.VERTICAL);
  
          linearLayout.addView(b0);
          linearLayout.addView(b1);
  
          return linearLayout;
      }
  
      public boolean isSupported() {
          return true;
      }
  
  }
  </code></pre>