Android copy/paste from clipboard manager

前端 未结 7 1013
情书的邮戳
情书的邮戳 2020-11-28 10:04

Is it possible to send past command so that it pastes text into currently focused edit text. Scenario:

  1. Background service listening for notification (done)
相关标签:
7条回答
  • 2020-11-28 10:50

    For best and easy way to copy paste programmatically is...

    Create a Button and copy this code in onclicklistener.

    ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); 
    

    For Copy

    clipboard.setText("which you want to copy"); 
    

    For paste

    textview1.setText(clipboard.getText().toString()); 
    
    0 讨论(0)
提交回复
热议问题