title: Can I use one layout with 2 activities?
body: <p>Can I use one layout with 2 activities?
  I have an activity called "download.java" and one called "upload.java) and ONE layout called "main_site.xml".</p>
  
  <p>"download.java" is the MainActivity
  It shows 2 buttons and an empty listview--> "Download", "Upload", "lv"</p>
  
  <p>When I click on upload the second activity "upload" would start up which starts "main_site.xml" for second time and the listview would be filled with data.</p>
  
  <p>Now I have 2 times "main_site.xml" one above the other... 
  How can I just fill the listiview and not opening a "new" layout?</p>
  
  <p><strong>OnCreate in download.java</strong></p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  
      setContentView(R.layout.main_site);
  
      if (android.os.Build.VERSION.SDK_INT &gt; 9) {
          StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
          StrictMode.setThreadPolicy(policy);
        }
  
  
      Button download = (Button)findViewById(R.id.cmd_download);
      download.setOnClickListener(new View.OnClickListener(){
  
          public void onClick(View v){
  
              connectFTP("176.28.25.46");
              listItems(); 
  
              } 
      });
  
      Button upload = (Button)findViewById(R.id.cmd_upload);
      upload.setOnClickListener(new View.OnClickListener(){
  
          public void onClick(View v){            
              Intent myIntent = new Intent(MainSite.this, upload.class);
              MainSite.this.startActivity(myIntent);
              } 
      });
  }
  </code></pre>
  
  <p><strong>OnCreate in upload.java</strong></p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main_site);
      myPath = (TextView)findViewById(R.id.path);
  
      root = Environment.getExternalStorageDirectory().getPath();
  
      getDir(root);
  }
  </code></pre>