當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。