title: How to carry text from my edittext, from 1 activity to another and clear if empty
body: <p>I have a problem with a task list/manager app I'm making. I have an EditText on my ViewTasksActivity with a button to go to AddTaskActivity I have it set up so that if text is entered into the ViewTasksActivity activity EditText, it will show it in the AddTaskActivity. This is good but it stores it in memory so if i enter new text on the ViewTasksActivity EditText it will actually add it to the end of what ever was written before and carry it to the AddTaskActivity! confusing! im sorry but i cant find the words to describe it! </p>
  
  <p>here is the code i have so far...</p>
  
  <p>public class ViewTasksActivity extends TaskManagerActivity {</p>
  
  <pre><code>private EditText taskNameEditText;
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      taskNameEditText = (EditText) findViewById (R.id.EditText_taskName);
  }
  
  // Buttons Start
  public void Button_chooseTaskList_Clicked(View view) {
  
  }
  public void Button_createNewTask_Clicked(View view) {
      String taskName = taskNameEditText.getText().toString();
      Task t = new Task(taskName);
      getTaskManagerApplication().addTask(t);
      Intent intent = new Intent(this, AddTaskActivity.class);
      startActivity(intent);
  }
  // Buttons End
  </code></pre>
  
  <p>}</p>
  
  <p>main.xml is </p>
  
  <pre><code>&lt;TableLayout 
      android:id="@+id/Table_tableTop"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_below="@id/Divider_1"
      android:paddingTop="5dip"
      android:paddingLeft="4dip"
      android:stretchColumns="2" &gt;
  
      &lt;TableRow&gt;
          &lt;Button
              android:id="@+id/Button_chooseTaskList"
              android:background="@drawable/iv_newtask"
              android:layout_column="1"
              android:onClick="Button_chooseTaskList_Clicked"
              /&gt;
          &lt;EditText
              android:id="@+id/EditText_taskName"
              android:hint="@string/edittext_hint_text_name"
              android:layout_column="2"
              android:textSize="13dip" 
              /&gt;
          &lt;Button
              android:id="@+id/Button_createNewTask"
              android:background="@drawable/button_addnewtask"
              android:layout_column="3"
              android:onClick="Button_createNewTask_Clicked"
              /&gt;
      &lt;/TableRow&gt;
  
  &lt;/TableLayout&gt;
  </code></pre>
  
  <p>addtaskactivity is </p>
  
  <pre><code>public class AddTaskActivity extends TaskManagerActivity {
  
  private EditText taskNameEditText;
  private DateFormat fmtDate = DateFormat.getDateInstance(DateFormat.LONG);
  private DateFormat fmtTime = DateFormat.getTimeInstance(DateFormat.SHORT);
  private TextView showDate;
  private TextView showTime;
  private TextView showEndDate;
  private TextView showEndTime;
  private Calendar myCalendar = Calendar.getInstance();
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.add_task);
  
      taskNameEditText = (EditText) findViewById (R.id.EditText_taskName);
      showDate = (TextView) findViewById(R.id.showDate);
      showTime = (TextView) findViewById(R.id.showTime);
      showEndDate = (TextView) findViewById(R.id.showEndDate);
      showEndTime = (TextView) findViewById(R.id.showEndTime);
  
      setupListSpinner();
  }
  
  
  @Override
  protected void onResume() {
      super.onResume();
      showTaskName();
  }
  
  private void showTaskName() {
      ArrayList&lt;Task&gt; tasks = getTaskManagerApplication().getCurrentTasks();
      StringBuffer sb = new StringBuffer();
      for (Task t:tasks) {
          sb.append(String.format("%s", t.toString()));
      }
      taskNameEditText.setText(sb.toString());
  }
  </code></pre>
  
  <p>add_task.xml is </p>
  
  <pre><code>&lt;TableLayout 
          android:id="@+id/Table_taskName"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_below="@id/Divider_1"
          android:paddingTop="5dip"
          android:paddingLeft="4dip"
          android:paddingRight="4dip"
          android:stretchColumns="2" &gt;
  
          &lt;TableRow&gt;
              &lt;EditText
                  android:id="@+id/EditText_taskName"
                  android:hint="@string/edittext_hint_text_name"
                  android:layout_column="2"
                  android:textSize="13dip" 
                  /&gt;
          &lt;/TableRow&gt;
  
      &lt;/TableLayout&gt;
  </code></pre>
  
  <p>as I said, it holds the info but even when the app is closed it still holds it in memory. 
  help please!!</p>
  
  <p>Thanks
  Kris</p>