The first is the call service for the system clipboard:
Clipboardmanager Clipboardmanager=getsystemservice (Context.clipboard_service);
Then it is written, taken out.
It is important to note that before Android version 11, the use of the Clipboard to pass data using the SetText and GetText methods, but after version 11, the two GetText and set methods are discarded, instead of the need to use the Clipdata object to pass the data. Compared with the GetText and SetText methods, the use of Clipdata objects to pass data, more consistent with object-oriented programming thinking, and the type of data can be passed more.
Clipdata cd = Clipdata.newplaintext ("zzzz", basetostring); Clipboardmanager.setprimaryclip (CD);
if (Cm.getprimaryclipdescription (). Hasmimetype (Clipdescription.mimetype_text_plain)) { = cm.getprimaryclip (); = Cd.getitemat (0); TxtView.setTextitem.getText (). toString ()); }
That's o.o for the time being.
Android uses clipboard (Clipboardmanager) for data transfer