Moving string from ClassA to Class B in Calendar on android
<p>I have tried few ways but non of them work on my code. Any ways, this is my onclick code from classA.</p>

<pre><code>public void onClick(View view)
{
    String date_month_year = (String) view.getTag();
    selectedDayMonthYearButton.setText("Selected: " + date_month_year);

    try
    {
        // comment added by SO: enter code here
        Date parsedDate = dateFormatter.parse(date_month_year);
        Log.d(tag, "Parsed Date: " + parsedDate.toString());
    }
    catch (ParseException e)
    {
        e.printStackTrace();
    }

    switch(view.getId())
    {
        case R.id.button1:
            Intent i = new Intent(DatabaseSample.this, SaveData.class);  
            startActivity(i);
            break;

    }
}

    public int getCurrentDayOfMonth()
    {
        return currentDayOfMonth;
    }

    private void setCurrentDayOfMonth(int currentDayOfMonth)
    {
            this.currentDayOfMonth = currentDayOfMonth;
    }
    public void setCurrentWeekDay(int currentWeekDay)
    {
            this.currentWeekDay = currentWeekDay;
    }
    public int getCurrentWeekDay()
    {
            return currentWeekDay;
    }
}
}
</code></pre>

<p>I want to move the string <strong>date_month_year</strong> to another class and display it. This is my code from Class B. I would like to know where the string would be read from and how to get it from the Class A to Class B.
When a user clicks on one of the dates the String date_month_year will the date the year and months ie 12/12/2012 I want to copy that string and show it in CLASS B <em>*</em> </p>

<pre><code>package com.app.DatabaseSample;

import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;

public class SaveData extends Activity implements OnClickListener {  
    private DataManipulator dh;     
    static final int DIALOG_ID = 0;

    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.save);
        View add = findViewById(R.id.Button01add);
        add.setOnClickListener(this);
        View home = findViewById(R.id.Button01home);
        home.setOnClickListener(this);           
    }

    public void onClick(View v){
        switch(v.getId()){

        case R.id.Button01home:
            Intent i = new Intent(this, DatabaseSample.class);
            startActivity(i);
            break;

        case R.id.Button01add:
            View editText1 = (EditText) findViewById(R.id.name);
            View editText2 = (EditText) findViewById(R.id.number);
            View editText3 = (EditText) findViewById(R.id.skypeId);
            View editText4 = (EditText) findViewById(R.id.address); 
            String myEditText1=((TextView) editText1).getText().toString();
            String myEditText2=((TextView) editText2).getText().toString();
            String myEditText3=((TextView) editText3).getText().toString();
            String myEditText4=((TextView) editText4).getText().toString();

            this.dh = new DataManipulator(this);
            this.dh.insert(myEditText1,myEditText2,myEditText3,myEditText4);

            showDialog(DIALOG_ID);
            break;

        }
    }  
    protected final Dialog onCreateDialog(final int id) {
        Dialog dialog = null;
        switch(id) {
        case DIALOG_ID:
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setMessage("Information saved successfully ! Add Another Info?")
            .setCancelable(false)
            .setPositiveButton("No", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    SaveData.this.finish();

              }
            })
            .setNegativeButton("Yes", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    dialog.cancel();
                }
            });
            AlertDialog alert = builder.create(); 
            dialog = alert;
            break;

        default:

        }
        return dialog;
    }



}
</code></pre>
