Your EditText is null. You first need to find that EditText in your hierarchy by using findViewById:
txtModbox = findViewById(R.id.txtModbox); txtModbox.setVisibility(View.GONE); On Mon, May 11, 2009 at 3:06 PM, jknox <jk...@trisoft.com> wrote: > > I am trying to use the visibility property to change the screen > display when certain events occur. [Okay, it's not elegant, but... > <G>] First few tries, and things went okay. I then added another > TextView and another EditText object. To simply, let's just consider > a couple of the TextView object, txtModbox and txtFilenam. > > <EditText > android:id="@+id/txtModbox" > android:layout_width="wrap_content" > android:layout_height="wrap_content" > android:singleLine="false" > android:layout_x="10px" > android:layout_y="170px" > > > </EditText> > <EditText > android:id="@+id/txtFilenam" > android:layout_width="wrap_content" > android:layout_height="wrap_content" > android:singleLine="false" > android:layout_x="100px" > android:layout_y="120px" > > > </EditText> > > > and in the Java: > > private EditText txtModbox; > private EditText txtFilenam; > > and > txtModbox.setVisibility(View.INVISIBLE); > //txtFilenam.setVisibility(View.INVISIBLE); > > If I comment out the txtFilenam INVISIBLE line, the emulator crashes > with a "Sorry. The application has stopped unexpectedly..." and > Eclipse show a lost connection. Eclipse is ver 3.4.2. and I believe > the Android SDK is current (downloaded a week or so ago). > > Any ideas??? Thanks... > > > -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ 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 android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---