我在Cordova(或phonegap)Android应用程序中使用了2周,包装好的apk加载了index.html两次(两页重叠),然后事件也两次退出。
细节:
1. I disigned a html5 page with contruct2 in which touch a image then alert "Ok";
2. I exported the project to android or phonegap
3. I wrapped it with CLI of crosswalk,it works fine;
4. I wrapped it with XDK,it works fine too;
5.I dont like these above two tools,apk size is too big;
6.I wrapped it(pages exported android or pages exported phonegap )
with CLI of cordova and CLI of Phonegap ,all fine except but the index.html
was loaded twice (the two pages overlap) and when touched the image, it alert twice.
能帮助我,非常感谢,所以很困惑。
答案 0 :(得分:1)
这似乎也发生在我身上。我知道这听起来很疯狂,但你的脚本标签之间是否有空格?
<script src="phonegap.js"> </script>
我删除了空格,并且复制停止了。
答案 1 :(得分:0)
首先尝试创建示例应用程序,然后应用自己的HTML5页面。在此处按照PhoneGap CLI应用程序创建过程进行操作: http://docs.phonegap.com/en/edge/guide_cli_index.md.html#The%20Command-Line%20Interface