I am taking the Android Tutorial and learning how to make apps, slowly but surely.
I have this in my Mainactvitiy:
public final static String EXTRA_MESSAGE = "com.mfr.firstapp.MESSAGE";
public void sendMessage(View view) {
Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.edit_message);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
And this in my Fragment_main.xml
<EditText
android:id="@+id/edit_messsage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/edit_message"
android:layout_weight="1">
</EditText>
Yet I am getting an error on this line
EditText editText = (EditText) findViewById(R.id.edit_message);
Telling me that "edit_message cannot be resolved or is not a field" Why would this be?
Regards
Matt