1
I wanted to copy and paste a string into a Listview, the function I’m using is just copying follows the function:
// Função Copiar
private void copiarTarefa(Context context, String text) {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) {
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
clipboard.setText(text);
} else {
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
android.content.ClipData clip = android.content.ClipData.newPlainText("Texto copiado: ", text);
clipboard.setPrimaryClip(clip);
}
Toast.makeText(context, "Texto copiado", Toast.LENGTH_LONG).show();
}
when I call the function so:
// Copiar Nota
listaTarefas.setLongClickable(true);
listaTarefas.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
copiarTarefa(getApplicationContext(), textoTarefa.getText().toString());
return true;
}
});
He just copies it, he doesn’t paste it, he just literally copies it.. where is the error, because I am not able to recover the note to be able to paste
Will copy from where and paste wave?
– Tiago P Casemiro
In the code I only see "copy". Where is the "paste"?
– ramaral
because it is Ramaral.. I wanted to know this
– Braynner Teixeira
copy and paste to desktop, tas understanding ?
– Braynner Teixeira
I wonder how I can put the necklace function
– Braynner Teixeira