Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>EditText should already have a context menu enabled. If it were not, then you would have to enable it by calling <a href="http://developer.android.com/reference/android/app/Activity.html#registerForContextMenu%28android.view.View%29" rel="nofollow noreferrer">registerForContextMenu</a>. Once you have the context menu enabled, you have to add items to it. This is done in <a href="http://developer.android.com/reference/android/app/Activity.html#onCreateContextMenu%28android.view.ContextMenu,%20android.view.View,%20android.view.ContextMenu.ContextMenuInfo%29" rel="nofollow noreferrer">onCreateContextMenu</a> by using one of the <a href="http://developer.android.com/reference/android/view/Menu.html#add%28int%29" rel="nofollow noreferrer">Menu.add methods</a>.</p> <p>The hard part is writing the code for <a href="http://developer.android.com/reference/android/app/Activity.html#onContextItemSelected%28android.view.MenuItem%29" rel="nofollow noreferrer">onContextItemSelected</a> after the user has selected an option. Saving text to the clipboard is simply a matter of calling <code>((ClipboardManager) getSystemService(CLIPBOARD_SERVICE)).setText("myText");</code>. However, first we need to find what text to copy. I haven't figured this last part out yet, but I am hopeful that I will soon.</p> <p><strong>Related Questions</strong></p> <ul> <li><a href="https://stackoverflow.com/questions/2662992/show-context-menu-when-link-is-long-pressed-in-textview/2671396#2671396">Show context menu when link is long pressed in TextView</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload