0

I found some code in stackoverflow and I want to use that code in my app. I have already overrided the EditText class(NoMenuEditText) like it is via link below. The question is what should I do now with that overrided class? I have EditText with id EditTextUserTask, how can I apply NoMenuEditText (overrided class) to EditTextUserTask inside my MainActivity?

EditText: Disable Paste/Replace menu pop-up on Text Selection Handler click event

I accept Java and Kotlin answers but if you can provide an answer in Kotlin, it would be better, thank you!

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841

1 Answers1

0

The question is what should I do now with that overrided class?

Just use your custom view in your layout.

<yourPackage.NoMenuEditText
   android:layout_width="match_parent"
   android:layout_height="......"
   android:id="@+id/editTextUserTask"
  />

In your MainActivity just

   NoMenuEditText ed = findViewById(R.id.editTextUserTask)
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841