예제 #1
0
 private boolean canPaste() {
   ClipboardManagerCompat clip = ClipboardManagerCompatFactory.getManager(getApplicationContext());
   if (clip.hasText()) {
     return true;
   }
   return false;
 }
예제 #2
0
 private void doPaste() {
   if (!canPaste()) {
     return;
   }
   ClipboardManagerCompat clip = ClipboardManagerCompatFactory.getManager(getApplicationContext());
   CharSequence paste = clip.getText();
   byte[] utf8;
   try {
     utf8 = paste.toString().getBytes("UTF-8");
   } catch (UnsupportedEncodingException e) {
     Log.e(TermDebug.LOG_TAG, "UTF-8 encoding not found.");
     return;
   }
   getCurrentTermSession().write(paste.toString());
 }
예제 #3
0
 private void doCopyAll() {
   ClipboardManagerCompat clip = ClipboardManagerCompatFactory.getManager(getApplicationContext());
   clip.setText(getCurrentTermSession().getTranscriptText().trim());
 }