title: Show copy/paste context menu on text using code android
body: <p>I have an <code>EditText</code> and its text gets selected from through code. But I want to allow users to cut/copy the selected text. However, the cut/copy context menu doesn't appear until user long presses on text. But then it loses the actual selection. So, I'm thinking to show the context menu as the text get selected by the code.</p>
  
  <p>I tried this inside onFocusChanged, but nothing appeared.</p>
  
  <pre><code>openContextMenu(EditText);
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/45gUv.png" alt="enter image description here"></p>