Android: Pass data to new Activity
<p>I'm new to android programming, and I'm pretty sure this is what I need. I've got a page that loads on start that has a spinner, some edit text boxes, and two buttons. One button clears out the boxes and resets the spinner. The other button should load a new activity (I guess) and I need what was in the EditTexts and the spinner to be loaded by that.</p>

<p>Right now I have it making a toast so I could test that everything was being grabbed properly. Here is my activity I have now: </p>

<pre><code>import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;

public class directoryApp extends Activity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.searchscreen);

        //Declaring these so I can use them when the button is clicked.
        final Spinner depts = (Spinner) findViewById(R.id.dept);
        final ArrayAdapter&lt;CharSequence&gt; deptsAdapter = new ArrayAdapter&lt;CharSequence&gt;(this, android.R.layout.simple_spinner_item);
        deptsAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        final EditText fname = (EditText) findViewById(R.id.fname);
        final EditText lname = (EditText) findViewById(R.id.lname);
        final EditText aim = (EditText) findViewById(R.id.aim);
        final EditText phone = (EditText) findViewById(R.id.phone);
        depts.setAdapter(deptsAdapter);
        for(int i = 0 ; i &lt; fillSpinner().length ; i++){
            deptsAdapter.add(fillSpinner()[i]);
        }


        //Search Button on click, makes a "toast" message with grabbed web string and whatever was entered into the fields.
        findViewById(R.id.search).setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                //Here is where the search button does it's thing.
                Toast.makeText(BNYDirectory.this, fname.getText() + " " + lname.getText() + " " + aim.getText() + " " + phone.getText() + " " + depts.getSelectedItem() + " " + deptIDs()[(int)depts.getSelectedItemId()], Toast.LENGTH_SHORT).show();
            }
        });
    }
}
</code></pre>

<p>I need to pass fname.getText(), lname.getText(), aim.getText(), phone.getText(), and deptIDs()[(int)depts.getSelectedItemId()] (all of which I am getting as strings).</p>

<p>What's the best way to go to the next page (which I will be using these to get results and display)? It's also possible that on click on the search I can have it grab the results from the web and put it into a string array and only pass that, but I'd rather not do that.</p>

<p>Any example I could use?</p>
