title: what is editText's data type in android studio?
body: <p>I'm trying to copy some text from an editText field in android studio but the app always crashes when I do.
  copying works fine, what crashes the app is copying from editText.</p>
  
  <p>I assumed it is String and tried casting it to a CharSequence, still crashes. I also tried copying from a TextView with no success, could it be the casting?</p>
  
  <pre><code>button3.setOnClickListener(
                  new Button.OnClickListener(){
                      @Override
                      public void onClick(View v) {
                          EditText editText = findViewById(R.id.editText);
                          ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
                          ClipData clip = ClipData.newPlainText("aaa",(CharSequence)editText);
                          clipboard.setPrimaryClip(clip);
                      }
                  }
          );
  </code></pre>
  
  <p>stack trace:</p>
  
  <pre><code>2019-04-28 03:46:47.121 29744-29744/my.app E/AndroidRuntime: FATAL EXCEPTION: main
      Process: my.app, PID: 29744
      java.lang.ClassCastException: android.support.v7.widget.AppCompatTextView cannot be cast to java.lang.CharSequence
          at my.app.MainActivity$3.onClick(MainActivity.java:68)
          at android.view.View.performClick(View.java:6597)
          at android.view.View.performClickInternal(View.java:6574)
          at android.view.View.access$3100(View.java:778)
          at android.view.View$PerformClick.run(View.java:25885)
          at android.os.Handler.handleCallback(Handler.java:873)
          at android.os.Handler.dispatchMessage(Handler.java:99)
          at android.os.Looper.loop(Looper.java:193)
          at android.app.ActivityThread.main(ActivityThread.java:6669)
          at java.lang.reflect.Method.invoke(Native Method)
          at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
  </code></pre>
  
  <p>btw <code>MainActivity.java:68</code> is <code>ClipData clip = ClipData.newPlainText("aaa",(CharSequence)editText);</code></p>