0

I don't know if this is possible but I am looking for a way to display a toast message after clicking on edittext.

I tried this but it didn't work:

        editText1.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Toast.makeText(RectangleWidth.this, "message here", Toast.LENGTH_SHORT).show();
    return;
        }

    });
user2749139
  • 109
  • 1
  • 3
  • 10

2 Answers2

1

First you should set the edit text to android:focusable="false" in your xml code

omid
  • 86
  • 3
0

Maybe it's not the best solution from a UI point of view. See here: Android EditText onClickListener

Community
  • 1
  • 1
Xavier Rubio Jansana
  • 6,388
  • 1
  • 27
  • 50