Javascript Ti.Media.takeScreenshot-只有创建视图层次结构的原始线程才能接触其视图
我在尝试拍摄屏幕截图时出现此错误。我可以拍摄屏幕,但即使同时出现此错误 这是我的密码Javascript Ti.Media.takeScreenshot-只有创建视图层次结构的原始线程才能接触其视图,javascript,android,titanium-mobile,Javascript,Android,Titanium Mobile,我在尝试拍摄屏幕截图时出现此错误。我可以拍摄屏幕,但即使同时出现此错误 这是我的密码 sharebutton.addEventListener('click', function(e) { Ti.Media.takeScreenshot(function(event) { //scrollView.toImage(); var filenameforscreenshot = "screenshot" + new Date().getDate()+".jpg
sharebutton.addEventListener('click', function(e) {
Ti.Media.takeScreenshot(function(event) {
//scrollView.toImage();
var filenameforscreenshot = "screenshot" + new Date().getDate()+".jpg";
Ti.API.info('cam filename-' + filenameforscreenshot);
var scrnImage = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, filenameforscreenshot);
scrnImage.write(event.media);
Ti.App.Properties.setString("screenshotcapture", scrnImage.nativePath);
});
var createnewWindow = require('ui/sharestay');
new createnewWindow(my_id, '').open();
win.close();
});
控制台中的错误
[ERROR] : TiExceptionHandler: (main) [0,5081] - Message: Uncaught Error: Only the original thread that created a view hierarchy can touch its views.
[ERROR] : TiExceptionHandler: (main) [0,5081] - Source: ).open(),o.close()}),u.addEventListener("click",function(){Ti.Media.takeScreen
[ERROR] : V8Exception: Exception occurred at ui/stay_listexpand.js:1: Uncaught Error: Only the original thread that created a view hierarchy can touch its views.
Plz help我被困在这里一天多了…如果需要更多信息,请发表评论。。。