title: Android Eclipse editText not displaying after setText on local instance
body: <p>I call on a few EditTexts  via "instanceOf" because I don't necessarily know the exact names / ids of them.  When I do this to get the text, it works just fine.  But when I try to setText() based on the local instanceOf EditText, it won't display the string I am passing it.  Oddly enough, when I setText and then Log the getText, it logs it correctly -- it just won't physically display it.  </p>
  
  <p>I also tested setting the visibility to View.INVISIBLE or View.GONE just to see if i can interact with it at all, and it doesn't do anything.</p>
  
  <p>Here is the code snippet that sets the text then logs it:</p>
  
  <pre><code>    LinearLayout mLayout = (LinearLayout) main_fields_holder.getChildAt(0);
           LinearLayout mLayout2 = (LinearLayout) mLayout.getChildAt(0);
           LinearLayout mLayout3 = (LinearLayout) mLayout2.getChildAt(1);
  for(int i = 0; i &lt; mLayout3.getChildCount(); i++){
                      View v = (View) mLayout3.getChildAt(i);
                      if (v instanceof EditText){
                          EditText e = (EditText) v;
                          e.setText("HELLO");
  
                          Log.v("USER TEXT", "Text is: " + e.getText().toString() + "!");
  
                          ;
  
                      }
  } 
  </code></pre>
  
  <p>I should also mention that I do the same instanceOf method with button text and it won't display my setText either.</p>
  
  <p>Is there some reason that a local instance of an editText (or button) cannot be manipulated?</p>
  
  <p>By the way, the line Log.v("USER TEXT", "Text is: " + e.getText().toString() + "!"); DOES give me "HELLO!".  I'm not even sure what that means for my problem.</p>
  
  <p>The main layout file is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
     &lt;LinearLayout    
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="vertical" 
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" 
          android:background="#fff"
          xmlns:android1="http://schemas.android.com/apk/res/android"&gt;
  
  
      &lt;ScrollView android:id="@+id/scrollView1" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
        &lt;LinearLayout 
          android:orientation="vertical" 
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" android1:focusable="false"&gt;
  
         &lt;LinearLayout android:id="@+id/item_edit_linear" 
          android:layout_height="wrap_content"
          android:background="@drawable/backrepeat"
          android:layout_width="fill_parent"
          &gt;
              &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/add_item_text" android:text="Add New Item" android:textStyle="bold" android:paddingLeft="15dip" android1:paddingTop="8dip" android1:textSize="12pt" android1:textColor="@color/blue"&gt;&lt;/TextView&gt;
          &lt;/LinearLayout&gt;
         &lt;LinearLayout android1:layout_height="wrap_content" android1:layout_width="fill_parent" android1:orientation="vertical" android1:paddingLeft="15dip" android1:background="@drawable/borderlines" android1:paddingBottom="15dip" android1:paddingTop="10dip" android1:id="@+id/spinner_holder_layout"&gt;
             &lt;TextView android1:layout_height="wrap_content" android1:layout_width="wrap_content" android1:paddingTop="5dip" android1:text="Item Name:" android1:textColor="@color/gray" android1:paddingBottom="5dip"&gt;&lt;/TextView&gt;
             &lt;EditText android1:layout_height="wrap_content" android1:layout_width="290dip" android1:id="@+id/edit_item_title"&gt;
                 &lt;requestFocus&gt;&lt;/requestFocus&gt;
             &lt;/EditText&gt;
             &lt;TextView android1:layout_height="wrap_content" android1:layout_width="wrap_content" android1:paddingTop="5dip" android1:id="@+id/textView9" android1:text="Select Category:" android1:textColor="@color/gray" android1:paddingBottom="5dip"&gt;&lt;/TextView&gt;
             &lt;Spinner android1:layout_height="wrap_content" android1:layout_width="wrap_content" android1:prompt="@string/edit_item_category_spinner_text" android1:id="@+id/edit_item_category_spinner" android1:entries="@array/categoryList" android1:paddingBottom="10dip"&gt;&lt;/Spinner&gt;
             &lt;LinearLayout android1:layout_height="wrap_content" android1:layout_width="fill_parent" android1:orientation="vertical" android1:id="@+id/item_spinner_layout" android1:visibility="gone"&gt;
                 &lt;TextView android1:layout_height="wrap_content" android1:layout_width="wrap_content" android1:paddingTop="5dip" android1:id="@+id/textView10" android1:text="Select Item" android1:textColor="@color/gray" android1:paddingBottom="5dip"&gt;&lt;/TextView&gt;
                 &lt;Spinner android1:layout_height="wrap_content" android1:layout_width="wrap_content" android1:prompt="@string/edit_item_item_spinner_text" android1:paddingBottom="10dip" android1:id="@+id/edit_item_spinner"&gt;&lt;/Spinner&gt;
             &lt;/LinearLayout&gt;
         &lt;/LinearLayout&gt;
         &lt;LinearLayout android1:layout_height="wrap_content" android1:layout_width="fill_parent" android1:orientation="vertical" android1:id="@+id/editItemFields"&gt;
  
         &lt;/LinearLayout&gt;
         &lt;LinearLayout android1:layout_marginLeft="15dip" android1:layout_width="fill_parent" android1:layout_height="wrap_content" android1:id="@+id/date_time_container" android1:visibility="gone"&gt;
             &lt;LinearLayout android1:layout_width="wrap_content" android1:layout_height="fill_parent" android1:id="@+id/linearLayout7" android1:orientation="vertical"&gt;
                 &lt;TextView android1:layout_width="fill_parent" android1:id="@+id/dep_date_text" android1:textColor="@color/gray" android1:layout_marginBottom="10dip" android1:text="Departure Date:" android1:gravity="right|center" android1:layout_height="36dip"&gt;&lt;/TextView&gt;
                 &lt;TextView android1:layout_width="fill_parent" android1:id="@+id/dep_time_text" android1:textColor="@color/gray" android1:layout_marginBottom="9dip" android1:text="Depature Time:" android1:gravity="right|center" android1:layout_height="36dip"&gt;&lt;/TextView&gt;
                 &lt;TextView android1:layout_width="fill_parent" android1:id="@+id/arr_date_text" android1:textColor="@color/gray" android1:layout_marginBottom="9dip" android1:text="Arrival Date:" android1:gravity="right|center" android1:layout_height="36dip"&gt;&lt;/TextView&gt;
                 &lt;TextView android1:layout_width="fill_parent" android1:id="@+id/arr_time_text" android1:textColor="@color/gray" android1:layout_marginBottom="9dip" android1:text="Arrival Time:" android1:gravity="right|center" android1:layout_height="36dip"&gt;&lt;/TextView&gt;
             &lt;/LinearLayout&gt;
             &lt;LinearLayout android1:layout_marginLeft="5dip" android1:layout_width="wrap_content" android1:layout_height="fill_parent" android1:id="@+id/linearLayout8" android1:orientation="vertical"&gt;
                 &lt;Button android1:layout_width="wrap_content" android1:layout_height="45dip" android1:id="@+id/departure_date" android1:minWidth="125dip" android1:text="Button"&gt;&lt;/Button&gt;
                 &lt;Button android1:layout_width="wrap_content" android1:layout_height="45dip" android1:id="@+id/departure_time" android1:minWidth="125dip" android1:text="Button"&gt;&lt;/Button&gt;
                 &lt;Button android1:layout_width="wrap_content" android1:layout_height="45dip" android1:id="@+id/arrival_date" android1:minWidth="125dip" android1:text="Button"&gt;&lt;/Button&gt;
                 &lt;Button android1:layout_width="wrap_content" android1:layout_height="45dip" android1:id="@+id/arrival_time" android1:minWidth="125dip" android1:text="Button"&gt;&lt;/Button&gt;
             &lt;/LinearLayout&gt;
         &lt;/LinearLayout&gt;
  
          &lt;LinearLayout android:layout_width="fill_parent" android:id="@+id/editItemLinearLayout" 
          android:layout_height="fill_parent" android:orientation="vertical" android1:paddingLeft="15dip" android1:visibility="gone"&gt;
          &lt;TextView android:text="Cost" android:id="@+id/textView1" 
              android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
          &lt;/TextView&gt;
          &lt;EditText android:layout_height="wrap_content" 
              android:layout_width="fill_parent" android:id="@+id/edit_item_cost"&gt;
          &lt;/EditText&gt;
          &lt;TextView android:text="Contact Phone" android:id="@+id/textView2" 
              android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
          &lt;/TextView&gt;
          &lt;EditText android:layout_height="wrap_content" 
              android:layout_width="fill_parent" android:id="@+id/edit_item_phone"&gt;
          &lt;/EditText&gt;
          &lt;TextView android:text="Carrier" android:id="@+id/textView3" 
              android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
          &lt;/TextView&gt;
          &lt;EditText android:layout_height="wrap_content" 
              android:layout_width="fill_parent" android:id="@+id/edit_item_carrier"&gt;
          &lt;/EditText&gt;
          &lt;TextView android:text="Names" android:id="@+id/textView4" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
          &lt;EditText android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@+id/edit_item_names"&gt;
          &lt;/EditText&gt;
          &lt;TextView android:text="Departure Location" android:id="@+id/textView5" 
              android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
          &lt;/TextView&gt;
          &lt;EditText  android:layout_height="wrap_content" 
              android:layout_width="fill_parent" android:id="@+id/edit_item_departure_location"&gt;
          &lt;/EditText&gt;
          &lt;TextView android:text="Arrival Location" android:id="@+id/textView6" 
              android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
          &lt;/TextView&gt;
          &lt;EditText android:layout_height="wrap_content" 
              android:layout_width="fill_parent" android:id="@+id/edit_item_arrival_location"&gt;
          &lt;/EditText&gt;
          &lt;TextView android:id="@+id/textView7" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Date"&gt;&lt;/TextView&gt;
          &lt;Button android:text="Button" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/edit_item_reminder_date"&gt;&lt;/Button&gt;
          &lt;TextView android:id="@+id/textView8" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Time"&gt;&lt;/TextView&gt;
          &lt;Button android:text="Button" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/edit_item_reminder_time"&gt;&lt;/Button&gt;
          &lt;/LinearLayout&gt;
          &lt;RelativeLayout android1:layout_width="fill_parent" android1:layout_marginTop="50dip" 
          android1:id="@+id/relativeLayout1" android1:layout_height="fill_parent"&gt;
              &lt;Button android1:id="@+id/edit_item_confirm" android1:layout_width="wrap_content" android1:layout_height="wrap_content" android1:background="@drawable/savebutton" android1:layout_alignParentBottom="true"&gt;&lt;/Button&gt;
              &lt;Button android1:width="159dip" android1:background="@drawable/cancelbutton" android1:layout_width="wrap_content" android1:id="@+id/item_creation_cancel" android1:layout_height="wrap_content" android1:layout_alignParentRight="true" android1:layout_alignParentBottom="true"&gt;&lt;/Button&gt;
          &lt;/RelativeLayout&gt;
  
          &lt;/LinearLayout&gt;
  
      &lt;/ScrollView&gt;
  
      &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Through code, I inflate the editItemFields Layout with the following:</p>
  
  <pre><code>&lt;LinearLayout android1:paddingLeft="15dip" android1:layout_width="fill_parent" 
  android1:background="@color/white" android1:id="@+id/flight_edit_container" 
  android1:orientation="vertical" android1:layout_height="fill_parent" 
  xmlns:android1="http://schemas.android.com/apk/res/android" android1:paddingTop="10dip"&gt;
      &lt;LinearLayout android1:layout_height="wrap_content" android1:layout_width="fill_parent" android1:id="@+id/linearLayout6"&gt;
          &lt;LinearLayout android1:layout_height="fill_parent" android1:layout_width="wrap_content" android1:id="@+id/linearLayout7" android1:orientation="vertical"&gt;
              &lt;TextView android1:id="@+id/TextView02" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:layout_height="36dip" android1:layout_marginBottom="10dip" android1:text="Airline:"&gt;&lt;/TextView&gt;
              &lt;TextView android1:text="Flight #:" android1:id="@+id/TextView05" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:layout_height="36dip" android1:layout_marginBottom="10dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:text="Gate:" android1:id="@+id/TextView04" android1:textColor="@color/gray" android1:gravity="right|center" android1:layout_width="100dip" android1:layout_height="36dip" android1:layout_marginBottom="10dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:id="@+id/TextView09" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:text="Departure Location:" android1:layout_height="36dip" android1:layout_marginBottom="10dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:text="Departure Airport:" android1:id="@+id/TextView14" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:layout_height="36dip" android1:layout_marginBottom="10dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:text="Confirmation #:" android1:id="@+id/TextView12" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:layout_height="36dip" android1:layout_marginBottom="9dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:gravity="right|center" android1:text="Destination:" android1:id="@+id/TextView08" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:layout_height="36dip" android1:layout_marginBottom="9dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:text="Arrival Airport:" android1:id="@+id/TextView15" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:layout_height="36dip" android1:layout_marginBottom="9dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:text="Cost:" android1:id="@+id/TextView09" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:layout_height="36dip" android1:layout_marginBottom="9dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:text="Class:" android1:id="@+id/TextView08" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:layout_height="36dip" android1:layout_marginBottom="9dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:text="Seat:" android1:id="@+id/TextView11" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:layout_height="36dip" android1:layout_marginBottom="9dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:text="Travelers:" android1:id="@+id/TextView12" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:layout_height="36dip" android1:layout_marginBottom="9dip"&gt;&lt;/TextView&gt;
              &lt;TextView android1:text="Memo:" android1:id="@+id/TextView13" android1:textColor="@color/gray" android1:layout_width="fill_parent" android1:gravity="right|center" android1:layout_height="36dip" android1:layout_marginBottom="9dip"&gt;&lt;/TextView&gt;
          &lt;/LinearLayout&gt;
          &lt;LinearLayout android1:layout_height="fill_parent" android1:layout_width="wrap_content" android1:id="@+id/linearLayout8" android1:orientation="vertical" android1:layout_marginLeft="5dip"&gt;
              &lt;EditText android1:layout_width="190dip" android1:layout_height="45dip" android1:id="@+id/flight_airline"&gt;&lt;/EditText&gt;
              &lt;EditText android1:layout_width="190dip" android1:id="@+id/flight_number" android1:layout_height="45dip"&gt;&lt;/EditText&gt;
              &lt;EditText android1:layout_width="190dip" android1:id="@+id/flight_gate" android1:layout_height="45dip"&gt;&lt;/EditText&gt;
              &lt;EditText android1:layout_width="190dip" android1:id="@+id/flight_deplocation" android1:layout_height="45dip"&gt;&lt;/EditText&gt;
              &lt;EditText android1:layout_width="190dip" android1:id="@+id/flight_depairport" android1:layout_height="45dip"&gt;&lt;/EditText&gt;
              &lt;EditText android1:layout_width="190dip" android1:id="@+id/flight_confirmation" android1:layout_height="45dip"&gt;&lt;/EditText&gt;
              &lt;EditText android1:layout_height="45dip" android1:layout_width="190dip" android1:id="@+id/flight_destination"&gt;&lt;/EditText&gt;
              &lt;EditText android1:layout_height="45dip" android1:layout_width="190dip" android1:id="@+id/flight_arrairport"&gt;
              &lt;/EditText&gt;
              &lt;EditText android1:layout_width="190dip" android1:layout_height="45dip" android1:id="@+id/flight_cost"&gt;&lt;/EditText&gt;
              &lt;EditText android1:layout_width="190dip" android1:layout_height="45dip" android1:id="@+id/flight_class"&gt;&lt;/EditText&gt;
              &lt;EditText android1:layout_width="190dip" android1:layout_height="45dip" android1:id="@+id/flight_seat"&gt;&lt;/EditText&gt;
              &lt;Button android1:text="Button" android1:minWidth="125dip" android1:id="@+id/flight_travelers" android1:layout_width="wrap_content" android1:layout_height="45dip"&gt;&lt;/Button&gt;
              &lt;EditText android1:layout_width="190dip" android1:id="@+id/flight_memo" android1:layout_height="45dip"&gt;&lt;/EditText&gt;
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
             &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I basically drill down into the layouts until i am at the linear layout that holds my editTexts.</p>
  
  <p>Finally, here is the code snippets that inflate the layout:</p>
  
  <pre><code>main_fields_holder = (LinearLayout) findViewById(R.id.editItemFields);
  view = LayoutInflater.from(getBaseContext()).inflate(R.layout.flight_fields,
                          null);
                   main_fields_holder.addView(view);
  </code></pre>
  
  <p>UPDATE:
  Just to test, I added this line to see if i can hard reference it by id:</p>
  
  <pre><code>EditText a = ((EditText)findViewById(R.id.flight_airline));
              a.setText("HELLO");
  </code></pre>
  
  <p>And it STILL won't show up.  Could the fact that I inflate the layout that holds these items have anything to do with it?  Basically when a spinner item is selected, a layout is inflated and I try to set the Text of the items in that layout, but to no avail.  Btw, I can also still trace out the value of the EditText after setting it, but the bugger just won't physically show up.</p>