本文整理汇总了Java中android.content.ClipboardManager.setText方法的典型用法代码示例。如果您正苦于以下问题:Java ClipboardManager.setText方法的具体用法?Java ClipboardManager.setText怎么用?Java ClipboardManager.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.content.ClipboardManager
的用法示例。
在下文中一共展示了ClipboardManager.setText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ua
import android.content.ClipboardManager; //导入方法依赖的package包/类
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);
}
示例2: aac_styTool
import android.content.ClipboardManager; //导入方法依赖的package包/类
public void aac_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 (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);
}
示例3: onCopyClick
import android.content.ClipboardManager; //导入方法依赖的package包/类
@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());
}
}
示例4: clicksvip
import android.content.ClipboardManager; //导入方法依赖的package包/类
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);
}
示例5: cclick
import android.content.ClipboardManager; //导入方法依赖的package包/类
public void cclick()
{
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);
}
示例6: dclick
import android.content.ClipboardManager; //导入方法依赖的package包/类
public void dclick()
{
EditText et=(EditText) findViewById(R.id.mainEditText1);
String os =et.getText().toString();
char[] a = os.toCharArray();
StringBuffer b = new StringBuffer("");
String mo ="爱\n";
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);
}
示例7: eclick
import android.content.ClipboardManager; //导入方法依赖的package包/类
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);}
示例8: getClipboardText
import android.content.ClipboardManager; //导入方法依赖的package包/类
private String getClipboardText()
{
ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
String text = "";
try
{
if (clipboard != null && clipboard.hasText())
{
CharSequence tmpText = clipboard.getText();
clipboard.setText(tmpText);
if (tmpText != null && tmpText.length() > 0)
{
text = tmpText.toString().trim();
}
}
}
catch (Exception e)
{
e.printStackTrace();
text = "";
}
return text;
}
示例9: copyTextToBoard
import android.content.ClipboardManager; //导入方法依赖的package包/类
@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);
}
示例10: onItemClick
import android.content.ClipboardManager; //导入方法依赖的package包/类
@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);
}
示例11: set
import android.content.ClipboardManager; //导入方法依赖的package包/类
public void set(final Context context, final String text)
{
try {
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(context.CLIPBOARD_SERVICE);
if( clipboard != null )
clipboard.setText(text);
} catch (Exception e) {
Log.i("SDL", "setClipboardText() exception: " + e.toString());
}
}
示例12: uncaughtException
import android.content.ClipboardManager; //导入方法依赖的package包/类
@Override
public void uncaughtException(Thread t, Throwable e) {
Looper.prepare();
StringBuffer sb=new StringBuffer();
StackTraceElement[] stackTrace = e.getStackTrace();
for (StackTraceElement stackTraceElement : stackTrace) {
sb.append(stackTraceElement.toString());
sb.append("\nfile: ");
sb.append(stackTraceElement.getFileName());
sb.append("\nclass: ");
sb.append(stackTraceElement.getClassName());
sb.append("\nmethod: ");
sb.append(stackTraceElement.getMethodName());
sb.append("\nline: ");
sb.append(stackTraceElement.getLineNumber());
sb.append("\n—————————————————\n");
}
Toast.makeText(MyApplication.getContext(),"Oops!出现错误!\n已将错误日志复制到粘贴板,请向作者反馈\n\n"+sb,Toast.LENGTH_LONG).show();
Toast.makeText(MyApplication.getContext(),"Oops!出现错误!\n已将错误日志复制到粘贴板,请向作者反馈\n\n"+sb,Toast.LENGTH_LONG).show();
ClipboardManager cmb = (ClipboardManager)MyApplication.getContext().getSystemService(Context.CLIPBOARD_SERVICE);
cmb.setText(sb);
//android.os.Process.killProcess(android.os.Process.myPid());
//System.exit(0);
Looper.loop();
}
示例13: copyLink
import android.content.ClipboardManager; //导入方法依赖的package包/类
@Override
public void copyLink() {
ClipboardManager cmb = (ClipboardManager)mContext.getSystemService(Context.CLIPBOARD_SERVICE);
cmb.setText(voditem.getContentURL());
ShowMessage.showToast(mContext,"复制完毕");
}
示例14: copy
import android.content.ClipboardManager; //导入方法依赖的package包/类
public static void copy(String content) {
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
cm.setText(content);
}
示例15: copyLink
import android.content.ClipboardManager; //导入方法依赖的package包/类
@Override
public void copyLink() {
ClipboardManager cmb = (ClipboardManager)mContext.getSystemService(Context.CLIPBOARD_SERVICE);
cmb.setText(ConstantValues.addH5ShareParams(item.getContentURL()));
ShowMessage.showToast(mContext,"复制完毕");
}