In my project I have two activities or classes. In first activity I have a EditText and I want to get the text of it from second class.
In the first class I wrote this code but it seems has problem.
public String getTextMessage()
{
return textMessage.getText().toString();
}
because in second class when I want to get it, program crashes.
message = encode.getTextMessage();
What is your suggestion?
Access the text by getText() from edit text and store it in an string. when you move to second activity sent string variable to second class via bundel. Extract the bundel in second class and use it.