title: How to Apply a Style of Copied Clip Board Text in Android
body: <p>I have Edit Text Which Contain Custom Fonts.When I <strong>Double Click</strong> on Edit Text, Text Will be Copied to <strong>Clip Board</strong> And When I Paste on Messaging App. or Other App. It Will Paste a Text Which Copied But <strong>It Does Not Reflect a Font Style</strong>, It Shows By Default Text Which Show in Image Below.</p>
  
  <p><img src="https://i.stack.imgur.com/A6VRQ.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/fmYw5.png" alt="enter image description here"></p>
  
  <p>here is my sample code for setting Custom Fonts For Edit Text and Copy text to Clip Board From Edit Text.</p>
  
  <pre><code>String Style = "C.A. Gatintas.ttf";
      face2 = Typeface.createFromAsset(getAssets(), "fonts/"
                      + style);
              edt2.setTypeface(face2);
  
  
  
  @SuppressWarnings("deprecation")
          final GestureDetector gestureDetector = new GestureDetector(
                  new GestureDetector.SimpleOnGestureListener() {
                      public boolean onDoubleTap(MotionEvent e) {
  
                          String text = edt2.getText().toString();
                          myClip = ClipData.newPlainText("text", text);
                          myClipboard.setPrimaryClip(myClip);
                          Toast.makeText(getApplicationContext(),
                                  "Text Copied to Clip Board", Toast.LENGTH_SHORT)
                                  .show();
  
                          return true;
                      }
                  });
  
          edt2.setOnTouchListener(new OnTouchListener() {
              public boolean onTouch(View v, MotionEvent event) {
  
                  return gestureDetector.onTouchEvent(event);
              }
  
          });
  </code></pre>