I wrote a code which copies an answer in calculator to clipboard, then calculator is closed and another window is opened. The answer should be pasted here using code:
textOut2= (TextView) findViewById(R.id.etInput1);
final ClipboardManager clipBoard= (ClipboardManager)getSystemService(CLIPBOARD_SERVICE);
textOut2.setText(clipBoard.getText());
but it never works. WHere could be a mistake? p.s. I know what text is copied because I can paste using long press but I want to do it automaticaly. And is it possible to give a specific name for a copied text? As it would make it easier to paste words as I have a lot of different TextView’s
You are allowed to add additional
ClipData.Itemitems with text viaClipData.addItem(), but there is no way to discern them.