public class MainActivity extends Activity {
public final static String EXTRA_MESSAGE = "com.example.realapptest1.MESSAGE";
TextView test;
EditText edittext;
String spokenwordstring;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
test = (TextView)findViewById(R.id.textView2);
edittext = (EditText)findViewById(R.id.spokenmsg);
spokenwordstring = edittext.getText().toString();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public void registermessage(View view) {
test.setText(spokenwordstring);
}
Basically I am trying to show whatever I write in an EditText on a TextView with the code above but I am not succeeding.
Any help is appreciated!