class clicker implements Button.OnClickListener
{
public void onClick(View v)
{
if(v==button1)
{
text1.setText(myChoice);
Toast.makeText(getBaseContext(),
"~~~~Successfully submitted~~~",
Toast.LENGTH_LONG).show();
}
if(v==button2)
{
/*Intent viewDataIntent = new Intent(SurveyActivity.this, Survey2.class);
String myData = "You should see this";
viewDataIntent.putExtra("valueOne", myData);
startActivity(viewDataIntent);
*/
text2.setText(text1.getText());
Toast.makeText(getBaseContext(),
text1.getText(),
Toast.LENGTH_LONG).show();
}
}
}
В вышеуказанной программе есть два поля editText text1 и text2;Я пытаюсь скопировать содержимое text1 в text2.Я пытался сделать text2.setText(text1.getText());
, но не работает.Есть идеи?