Ive fixed it, but its strage, if i create it from xml file it dont throws an exception. Within the code i must turn off the baseline alginment.
On 25 Jun., 15:28, "Mr.No" <f.hi...@arcor.de> wrote: > Hi folks, > ive a little problem: > > Why is the following code causing an exception? > The Code throws a "mBaselineAlignedChildIndex of LinearLayout set to > an index that is out of bounds" exception. > > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > > LinearLayout l1 = new LinearLayout(this); > LinearLayout l2 = new LinearLayout(this); > l1.addView(l2); > this.setContentView(l1); > > } > > If l2 is dont added to l1 than it works. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---