skip to Main Content

with android:textIsSelectable="true" i have only copy and share functionality by the system but i want to have a pop up with that word definition

In addition, it would be great if i can highlight that selected word

2

Answers


  1. You can use the popup window with the context menu. That suits your requirement perfectly
    I could suggest you https://programmersought.com/article/5691145305/ or
    https://www.geeksforgeeks.org/popup-menu-in-android-with-example/

    Change it according to your needs.

    Login or Signup to reply.
  2. U CAN USE THIS CODE

     button.setOnLongClickListener {
     Snackbar.make(root_layout, "Long click", Snackbar.LENGTH_INDEFINITE).show()
    true
    }
    

    in addition to it u can give a custom dialog, toast msg as wellstrong text

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search