Problem
The setData, hasData and getData methods of [Titanium.UI.Clipboard](
http://docs.appcelerator.com/titanium/2.0/index.html#!/api/Titanium.UI.Clipboard) do not have any effect. This is mostly because setData's source code only converts the input to string but does not save it. Also, has data should return a boolean, but does not.
See the test case below, and the source at [ClipboardModule.java](
https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/clipboard/ClipboardModule.java).
Test case
Ti.UI.setBackgroundColor('#000');
Ti.UI.Clipboard.setData('text/plain', 'hello'); // does not store data
Ti.API.log('Does the Clipboard contain any data?...' + Ti.UI.Clipboard.hasData('text/plain')); // does not output boolean
Ti.API.log('Getting hello text from Clipboard...' + Ti.UI.Clipboard.getData('text/plain')); // does not generate any output
Ti.API.log('getText: ' + Ti.UI.Clipboard.getText()); // should this return data stored with setData where a mime type with a text prefix is specified?
Logs
No errors are generated.
APIDOC fixed in https://github.com/appcelerator/titanium_mobile/pull/2269
The clipboard methods setData, hasData, hasText, getData and getText returning appropriate values. Verified on: Titanium Studio: 2.1.0.201206010843 Titanium SDK: 2.1.0.v20120604151821 Android Emulator 2.2 Runtime: v8
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4731