I am trying to create commands for editText, so when you type in a keyword some code will run. I am using this code now, but it doesn't seem to work.
@Override
public void editText (String editText)
{
if(editText == ("closer"))
{
((ViewGroup.MarginLayoutParams) red.getLayoutParams()).topMargin += 1;
// image.setRotation(image.getRotation() + 1);
red.requestLayout();
((ViewGroup.MarginLayoutParams) blue.getLayoutParams()).topMargin -= 1;
// image2.setRotation(image2.getRotation() + 1);
}
When i type in the word and hit enter, the edit text just creates a new line. But I want to be able to hit enter and the code runs, on what ever you type in.