简体   繁体   English

cordova.exec()破坏了我的应用程序代码

[英]cordova.exec() is breaking my app code

I am developing an Ipad app with HTML5, Javascript/JQuery Mobile and Cordova/Phonegap. 我正在使用HTML5,Javascript / JQuery Mobile和Cordova / Phonegap开发Ipad应用程序。 One of its features is to build and send an email, I am doing this using EmailComposer , the problem is that after the emailcomposer's screen runs and I return to the app, many of the list views (generated by Jquery Mobile) stop working. 它的功能之一是构建和发送电子邮件,我正在使用EmailComposer进行此操作,问题是在emailcomposer的屏幕运行并且我返回到应用程序后,许多列表视图(由Jquery Mobile生成)停止工作。

Debugging I found that this happens when the function cordova.exec() runs. 调试时,我发现这在函数cordova.exec()运行时发生。 I tried to pass empty args, thought that maybe something were conflicting but the problem persists. 我试图传递空的args,以为可能有些冲突,但是问题仍然存在。

cordova.exec(null, null, "EmailComposer", "showEmailComposer", [args]);

Any idea of what could be causing this? 知道是什么原因造成的吗?

I don't think the issue is to do specifically with cordova.exec - that is just the method call for any native functionality. 我认为问题不是专门针对cordova.exec -这仅仅是对任何本机功能的方法调用。

Sounds more like part of your view is being redrawn and not getting enhanced by jQuery Mobile. 听起来更像是您的视图的一部分正在被重绘,而jQuery Mobile并未对其进行增强。 You can trigger the create or refresh events on jQuery Mobile when you return to your app. 返回应用程序时,可以在jQuery Mobile上触发createrefresh事件。

See the section on updating lists at the bottom of this page http://jquerymobile.com/test/docs/lists/docs-lists.html 请参阅本页底部有关更新列表的部分http://jquerymobile.com/test/docs/lists/docs-lists.html

I also faced the same problem, but now I solved it: 我也遇到了同样的问题,但是现在我解决了:

In "cordova.plist" write Key:EmailComposer and value:EmailComposer . 在“ cordova.plist”中,编写Key:EmailComposervalue:EmailComposer

That's it! 而已!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM