本文整理匯總了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,"複製完畢");
}