1. It used to be that your custom component subclassed AbsoluteLayout. If it still does, I suspect you cannot use LinearLayout.LayoutParams with an AbsoluteLayout. You should make those consistent, either by changing the superclass, or by changing the LayoutParams.
I just changed it from AbsoluteLayout to LinearLayout, and it worked! Thanks! Sylvester On Jul 7, 6:26 pm, Mark Murphy <[EMAIL PROTECTED]> wrote: > Given the logcat output, the exception is apparently being raised in > these lines: > > this.addView(textView2, new > LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); > this.addView(textView, new > LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, > LayoutParams.WRAP_CONTENT)); > > Off the cuff, I can think of two possible reasons, and there may be others: > > 1. It used to be that yourcustomcomponent subclassed AbsoluteLayout. > If it still does, I suspect you cannot use LinearLayout.LayoutParams > with an AbsoluteLayout. You should make those consistent, either by > changing the superclass, or by changing the LayoutParams. > > 2. It is a little unclear where in your activity all this is being > called. It is conceivable that the superclass (e.g., AbsoluteLayout) is > not initialized sufficiently to accept child views at this time. > > You will get better diagnostic information if you can get the exception > stack trace logged. e.printStackTrace() goes nowhere in Android, AFAIK > -- I think there's something you have to do to have stderr results go to > the logcat output. > > -- > Mark Murphy (a Commons Guy)http://commonsware.com > Android Training on the Ranch in September!http://www.bignerdranch.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

