I am developing an android application in which i have taken two buttons and one edit text box. i want to pass the data of edit text box in from of string to the next activi
You can use intents for the purpose. Here's a tutorial for the same.
Also check How to pass the values from one activity to previous activity
Reading the contents of a String on Button click.
EditText mText = (EditText)findViewById(R.id.edittext1);
Button mButton = (Button)findViewById(R.id.button1);
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String text = mText.getText.toString();
Intent intent = new Intent(this, Activity2.class);
intent.putExtra("key", text);
startActivity(intent);
}
});