I am getting a the error in the onClick method when the EditText object is referenced.
public class messageActivity extends AppCompatActivity {
EditText editText;
Button button;
Logic logic;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_message);
editText = (EditText) findViewById(R.id.editText);
button = (Button) findViewById(R.id.button6);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
logic.message(editText.getText().toString());
}
});
}
}
Here is the XML for the EditText
widget in my activity:
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/editText"
android:layout_below="@+id/textView3"
android:layout_centerHorizontal="true"
android:layout_marginTop="83dp"
android:inputType="textShortMessage"
android:editable="false" />