sketchub icon

How to copy text and share in Android

CoCoCo_CoCoCo
8 Likes
3 Comments
36 Downloads

Screenshots

About

  • No problem 100%
- add variable: String (share)
  • Imageview1 onClick:
((ClipboardManager) getSystemService(getApplicationContext().CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("clipboard", textview1.getText().toString()));
SketchwareUtil.showMessage(getApplicationContext(), "Copy to Clipboard");
  • Imageview2 onClick:
share = textview1.getText().toString();
Intent i = new Intent(android.content.Intent.ACTION_SEND);i.setType("text/plain"); i.putExtra(android.content.Intent.EXTRA_TEXT, share); startActivity(Intent.createChooser(i,"Share using"));
  • Sketchware Pro Nightly Download Free:
https://sketchware.pro/download#download

©2024 Sketchub | User Policy