I made the changes you suggested: I got rid of the XML file. My calling class looks like:
Log.v("Main activity","before new CustomEditText (this)"); customEditText = new CustomEditText (this); //customEditText = (CustomEditText)this.findViewById(R.layout.component); Log.v("Main activity","initializing custom component"); try { customEditText.initialize(); } catch (RuntimeException e) { // TODO Auto-generated catch block e.printStackTrace(); Log.v("Main activity","runtime exception caught"); } Log.v("Main activity","setting custom component"); customEditText.setItem1("blah"); Log.v("Main activity","showing custom component"); this.setContentView(customEditText); My initialize function is: public void initialize (){ Log.v("CustomEditText constructor","before initializing textView"); //textView= (TextView)this.findViewById(R.id.textView); textView= new TextView(context); Log.v("CustomEditText constructor","initialized textView"); //editText= (EditText)activity.findViewById(R.id.editText); textView2= new TextView(context); //textView2= (TextView)this.findViewById(R.id.textView); Log.v("CustomEditText constructor","initialized editText"); // TODO Auto-generated constructor stub this.addView(textView2, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT)); this.addView(textView, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); } and my logCat shows this: DEBUG/ActivityThread(713): Performing launch of ActivityRecord{400a9870 [EMAIL PROTECTED] {com.customcomponent/com.customcomponent.customComponentActivity}} VERBOSE/Main activity(713): before findViewById VERBOSE/Main activity(713): initializing custom component VERBOSE/CustomEditText constructor(713): before initializing textView VERBOSE/CustomEditText constructor(713): initialized textView VERBOSE/CustomEditText constructor(713): initialized editText VERBOSE/Main activity(713): runtime exception caught VERBOSE/Main activity(713): setting custom component VERBOSE/CustomEditText setItem(713): set textView VERBOSE/CustomEditText setItem(713): set editText VERBOSE/Main activity(713): showing custom component So, according to the logCat this runs into a runtime exception but still goes on as if nothing has happened. the output by the way is just a blank dark screen. Thanks, Sylvester --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---