当前位置: 首页>>代码示例>>Java>>正文


Java ClipboardManager.setText方法代码示例

本文整理汇总了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);
   }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:17,代码来源:gifa.java

示例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);
   }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:17,代码来源:gifa.java

示例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());
    }
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:19,代码来源:MessageAdapter.java

示例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);
   }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:17,代码来源:gifa.java

示例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);
   }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:18,代码来源:gifa.java

示例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);
   }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:18,代码来源:gifa.java

示例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);}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:17,代码来源:gifa.java

示例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;
   }
 
开发者ID:stytooldex,项目名称:stynico,代码行数:24,代码来源:x5_MainActivity.java

示例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);
}
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:9,代码来源:DeviceUtils.java

示例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);
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:14,代码来源:KILL.java

示例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());
	}
}
 
开发者ID:NeoTerm,项目名称:NeoTerm,代码行数:11,代码来源:Clipboard.java

示例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();



}
 
开发者ID:Delsart,项目名称:Bookster,代码行数:30,代码来源:MyCrashHandler.java

示例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,"复制完毕");
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:7,代码来源:PictureSetActivity.java

示例14: copy

import android.content.ClipboardManager; //导入方法依赖的package包/类
public static void copy(String content) {
    ClipboardManager cm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
    cm.setText(content);
}
 
开发者ID:7449,项目名称:JsoupSample,代码行数:5,代码来源:UIUtils.java

示例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,"复制完毕");
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:7,代码来源:ImageTextActivity.java


注:本文中的android.content.ClipboardManager.setText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。