title: Programming to android, My layout xml files won't update when i build the project
body: <p>I'm working currently on a test project in order to practice some of the basic features of android layout before i get to work on my project.
  For now i'm experiencing with some buttons and activity change, and got stack on one frustrating problem.</p>
  
  <p>At first i wasn't sure why my new Layout just won't show some buttons I've placed on it, but now the problem get weirder.
  As i will soon show in my code, I've got two layout xml files, one to handle the main activity and one to handle the 2nd. at first all was well, but then I've noticed i can't see the lone button on the 2nd layout, and i couldn't understand why. i've tried to change the 2nd layout to be the main layout (just my changing the setContentView() in the main activity), but weirdly enough, the program kept calling the original layout instead of the one specified in the code (of course i've check for errors, or if it was actually have been build, it did, i also inserted errors on purpose and check that the program fail to start). 
  Seeing that there might be some deeper problem, i've tried to add another button to the main layout xml file, but to no vial, the program kept starting with the old one.</p>
  
  <p>I've search for answer, tried to clean my project, and rebuild it, looked for missing files in my string xml, but nothing could fix it up, I'm clueless at the moment for what went wrong.</p>
  
  <p>I do assume that if i start over with the project everything will be fine, but i can't start a new project every time the problem rising. (especially if I'm doing something wrong).</p>
  
  <p>here is my code:</p>
  
  <p>main Activity: 
   $
  package test.android.mark.III;</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.Gravity;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  import android.widget.PopupWindow;
  
  public class AndroidMarkIII extends Activity {
      /** Called when the activity is first created. */
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main1);
  
          final Button button1 = (Button) findViewById(R.id.button1); // bind button to the view from the xml
      button1.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              openNewWindow(v);
          }
      });   
      final Button button2 = (Button) findViewById(R.id.button2);// bind button to the view from the xml
  
      button2.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              openPopupWindow(button2);
          }
      });
      }
  
  protected void openNewWindow(View v) {
      Intent listWindowIntent = new Intent(v.getContext(), ListWindowActivity.class);
      startActivityForResult(listWindowIntent, 0);
  }
  }
  </code></pre>
  
  <p>My 2nd activity:
      package test.android.mark.III;</p>
  
  <pre><code>import android.app.Activity;
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.view.View.OnClickListener;
  import android.widget.Button;
  
  public class ListWindowActivity extends Activity {
  
  public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main2);
  
  Button returnButton = (Button) findViewById(R.id.return_button);
  returnButton.setOnClickListener(new OnClickListener() {
  
      @Override
      public void onClick(View v) {
          Intent intent = new Intent();
          setResult(RESULT_OK, intent);
          finish();
  
      }
  });
  
  }
  
  }
  </code></pre>
  
  <p>My main XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"&gt;
  
  &lt;TextView
      android:id="@+id/title1"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="@string/title1"
      android:layout_centerHorizontal="true" /&gt;
  &lt;Button
      android:id="@+id/button1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@id/title1"
      android:layout_centerHorizontal="true"
      android:text="@string/push_button"
      android:padding="50dp" /&gt;
  
  &lt;Button
      android:id="@+id/button2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@id/button1"
      android:text="@string/popup_button"
      android:layout_centerHorizontal="true"
      android:padding="75dp" /&gt;
  &lt;TextView   //Was added later for check reason (wasn't seen on any run)
      android:id="@+id/end"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="@string/title1" 
      android:layout_centerHorizontal="true"/&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>my 2nd XML (for the 2nd activity)
      
      </p>
  
  <pre><code>&lt;TextView
      android:id="@+id/list_text"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:text="Hello World" /&gt;
  
  &lt;Button 
      android:id="@+id/return_button"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="@string/return_button"
      android:visibility="visible"&gt;
  &lt;/Button&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and for any case, my strings xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;resources&gt;
  
  &lt;string name="hello"&gt;Hello World, AndroidMarkIIIActivity!&lt;/string&gt;
  &lt;string name="app_name"&gt;AndroidMarkIII&lt;/string&gt;
  &lt;string name="title1"&gt;This is a test program&lt;/string&gt;
  &lt;string name="push_button"&gt;Push Button - 50dp&lt;/string&gt;
  &lt;string name="popup_button"&gt;Popup Button - 75dp&lt;/string&gt;
  &lt;string name="return_button"&gt;return Button - 10dp&lt;/string&gt;
  &lt;string name="close_popup_button"&gt;X&lt;/string&gt;
  &lt;string name="popup_text"&gt;this is popup - 25dp&lt;/string&gt;
  &lt;string name="list_window_app_name"&gt;AndroidMarkIII2ndWindow&lt;/string&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>and my manfiest xml
      
      </p>
  
  <pre><code>&lt;uses-sdk android:minSdkVersion="14" /&gt;
  
  &lt;application
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name" &gt;
      &lt;activity
          android:label="@string/app_name"
          android:name=".AndroidMarkIII" &gt;
          &lt;intent-filter &gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity android:name=".ListWindowActivity"&gt;
      &lt;/activity&gt;
  
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>I really hope someone will be able to solve that problem, cause it seems actually like a really silly problem, but still, can't keep working while i'm having it.</p>
  
  <p>Thanks in advance
  Oren</p>