Java Code Examples for android.content.ClipboardManager#setText()
The following examples show how to use
android.content.ClipboardManager#setText() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: gifa.java From stynico with MIT License | 6 votes |
public void ac_styTool() { EditText et=(EditText) findViewById(R.id.mainEditText1); String os =et.getText().toString(); char[] a = os.toCharArray(); StringBuffer b = new StringBuffer(""); String mo =getResources().getString(R.string.android_gifb); for (int i=0;i < a.length;i++) { b.append(mo.replace('n', a[i])) ; ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(b); } TextView t=(TextView) findViewById(R.id.mainTextView1); t.setText(b); }
Example 2
Source File: gifa.java From stynico with MIT License | 6 votes |
public void ua() { EditText et=(EditText) findViewById(R.id.mainEditText1); String os =et.getText().toString(); char[] a = os.toCharArray(); StringBuffer b = new StringBuffer(""); String mo ="妮̶"; for (int i=0;i < a.length;i++) { b.append(mo.replace('妮', a[i])) ; ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(b); } TextView t=(TextView) findViewById(R.id.mainTextView1); t.setText(b); }
Example 3
Source File: gifa.java From stynico with MIT License | 6 votes |
public void click() { EditText et=(EditText) findViewById(R.id.mainEditText1); String os =et.getText().toString(); char[] a = os.toCharArray(); StringBuffer b = new StringBuffer(""); String mo ="ζั͡爱 ั͡✾"; for (int i=0;i < a.length;i++) { b.append(mo.replace('爱', a[i])) ; ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(b); } TextView t=(TextView) findViewById(R.id.mainTextView1); t.setText(b); }
Example 4
Source File: gifa.java From stynico with MIT License | 6 votes |
public void bclick() { EditText et=(EditText) findViewById(R.id.mainEditText1); String os =et.getText().toString(); char[] a = os.toCharArray(); StringBuffer b = new StringBuffer(""); String mo ="爱҉"; for (int i=0;i < a.length;i++) { b.append(mo.replace('爱', a[i])) ; ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(b); } TextView t=(TextView) findViewById(R.id.mainTextView1); t.setText(b); }
Example 5
Source File: gifa.java From stynico with MIT License | 6 votes |
public void eclick() { EditText et=(EditText) findViewById(R.id.mainEditText1); String os =et.getText().toString(); char[] a = os.toCharArray(); StringBuffer b = new StringBuffer(""); String mo =" 爱"; for (int i=0;i < a.length;i++) { b.append(mo.replace('爱', a[i])) ; ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(b); } TextView t=(TextView) findViewById(R.id.mainTextView1); t.setText(b);}
Example 6
Source File: gifa.java From stynico with MIT License | 6 votes |
public void clicksvip() { EditText et=(EditText) findViewById(R.id.mainEditText1); String os =et.getText().toString(); char[] a = os.toCharArray(); StringBuffer b = new StringBuffer(""); String mo ="❦H❧"; for (int i=0;i < a.length;i++) { b.append(mo.replace('H', a[i])) ; ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(b); } TextView t=(TextView) findViewById(R.id.mainTextView1); t.setText(b); }
Example 7
Source File: MessageAdapter.java From sctalk with Apache License 2.0 | 6 votes |
@SuppressWarnings("deprecation") @SuppressLint("NewApi") @Override public void onCopyClick() { try { ClipboardManager manager = (ClipboardManager) ctx.getSystemService(Context.CLIPBOARD_SERVICE); logger.d("menu#onCopyClick content:%s", mMsgInfo.getContent()); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) { ClipData data = ClipData.newPlainText("data", mMsgInfo.getContent()); manager.setPrimaryClip(data); } else { manager.setText(mMsgInfo.getContent()); } } catch (Exception e) { logger.e(e.getMessage()); } }
Example 8
Source File: gifa.java From styT with Apache License 2.0 | 5 votes |
public void ac_styTool() { EditText et = (EditText) findViewById(R.id.mainEditText1); String os = et.getText().toString(); char[] a = os.toCharArray(); StringBuffer b = new StringBuffer(""); String mo = getResources().getString(R.string.android_gifb); for (char anA : a) { b.append(mo.replace('n', anA)); ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(b); } TextView t = (TextView) findViewById(R.id.mainTextView1); t.setText(b); }
Example 9
Source File: DeviceUtils.java From Aurora with Apache License 2.0 | 5 votes |
@SuppressWarnings("deprecation") public static void copyTextToBoard(Context context, String string) { if (TextUtils.isEmpty(string)) return; ClipboardManager clip = (ClipboardManager) context .getSystemService(Context.CLIPBOARD_SERVICE); clip.setText(string); }
Example 10
Source File: gifa.java From styT with Apache License 2.0 | 5 votes |
public void c_styTool() { EditText et = (EditText) findViewById(R.id.mainEditText1); String os = et.getText().toString(); char[] a = os.toCharArray(); StringBuffer b = new StringBuffer(""); String mo = getResources().getString(R.string.android_gifa); for (char anA : a) { b.append(mo.replace('n', anA)); ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(b); } TextView t = (TextView) findViewById(R.id.mainTextView1); t.setText(b); }
Example 11
Source File: KILL.java From stynico with MIT License | 5 votes |
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { TextView tv_appName = (TextView) view.findViewById(R.id.tv_app_name); TextView tv_processName = (TextView) view.findViewById(R.id.tv_app_process_name); String appName = tv_appName.getText().toString(); String processName = tv_processName.getText().toString(); Toast.makeText(KILL.this, "已复制" + "应用+进程", Toast.LENGTH_SHORT).show(); ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText("应用: " + appName + "\n进程: " + processName); }
Example 12
Source File: gifa.java From styT with Apache License 2.0 | 5 votes |
public void click() { EditText et = (EditText) findViewById(R.id.mainEditText1); String os = et.getText().toString(); char[] a = os.toCharArray(); StringBuffer b = new StringBuffer(""); String mo = "ζั͡爱 ั͡✾"; for (char anA : a) { b.append(mo.replace('爱', anA)); ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(b); } TextView t = (TextView) findViewById(R.id.mainTextView1); t.setText(b); }
Example 13
Source File: LinkHandler.java From RedReader with GNU General Public License v3.0 | 5 votes |
public static void onActionMenuItemSelected(String uri, AppCompatActivity activity, LinkAction action){ switch (action){ case SHARE: shareText(activity, null, uri); break; case COPY_URL: ClipboardManager manager = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE); manager.setText(uri); break; case EXTERNAL: try { final Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(uri)); activity.startActivity(intent); } catch(final ActivityNotFoundException e) { General.quickToast(activity, R.string.error_no_suitable_apps_available); } break; case SHARE_IMAGE: ((BaseActivity)activity).requestPermissionWithCallback(Manifest.permission.WRITE_EXTERNAL_STORAGE, new ShareImageCallback(activity, uri)); break; case SAVE_IMAGE: ((BaseActivity)activity).requestPermissionWithCallback(Manifest.permission.WRITE_EXTERNAL_STORAGE, new SaveImageCallback(activity, uri)); break; } }
Example 14
Source File: gifa.java From styT with Apache License 2.0 | 5 votes |
public void ua() { EditText et = (EditText) findViewById(R.id.mainEditText1); String os = et.getText().toString(); char[] a = os.toCharArray(); StringBuffer b = new StringBuffer(""); String mo = "妮̶"; for (char anA : a) { b.append(mo.replace('妮', anA)); ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(b); } TextView t = (TextView) findViewById(R.id.mainTextView1); t.setText(b); }
Example 15
Source File: ClipBoardUtil.java From styT with Apache License 2.0 | 5 votes |
/** * 实现文本复制功能 * * @param content */ @SuppressLint("NewApi") public static void copy(Context context, String content) { // 得到剪贴板管理器 ClipboardManager cmb = (ClipboardManager) context .getSystemService(Context.CLIPBOARD_SERVICE); cmb.setText(content.trim()); }
Example 16
Source File: TDevice.java From Cotable with Apache License 2.0 | 5 votes |
@SuppressWarnings("deprecation") public static void copyTextToBoard(String string) { if (TextUtils.isEmpty(string)) return; try { ClipboardManager clip = (ClipboardManager) BaseApplication.context() .getSystemService(Context.CLIPBOARD_SERVICE); clip.setText(string); } catch (Exception e) { e.printStackTrace(); } }
Example 17
Source File: TDevice.java From android-project-wo2b with Apache License 2.0 | 5 votes |
@SuppressWarnings("deprecation") public static void copyTextToBoard(Context context, String string) { if (TextUtils.isEmpty(string)) return; ClipboardManager clip = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); clip.setText(string); }
Example 18
Source File: RequestActivity.java From Android with MIT License | 4 votes |
@OnClick(R.id.address_lin) void goCopy(View view) { ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); cm.setText(MemoryDataManager.getInstance().getAddress()); ToastEUtil.makeText(mActivity,R.string.Set_Copied).show(); }
Example 19
Source File: TagSearchWithMessageActivity.java From talk-android with MIT License | 4 votes |
private void copyToClipboard(String string) { ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); manager.setText(string); }
Example 20
Source File: ModifyInfoActivity.java From Android with MIT License | 4 votes |
@OnClick(R.id.id_ll) void goId(View view) { ClipboardManager cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); cm.setText(userBean.getAddress()); ToastEUtil.makeText(mActivity,R.string.Set_Copied).show(); }