gpt4 book ai didi

android - Phonegap 1.4.1 WebIntent 插件错误 "Class not found"Android

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:33:27 24 4
gpt4 key购买 nike

我是 phonegap 开发的新手,如果这是一个明显的答案,我很抱歉。这是我项目的最后一部分,其中唯一不起作用的部分是插件。

我收到消息“无法通过 Android Intent 发送电子邮件”,并在 logcat 中收到以下错误“错误:Status=2 Message=Class not found at file:///android_asset/www/phonegap-1.4.1. js:651"

我想不通,我过去一天一直在搞这个!

我已将插件添加到 plugin.xml

插件名称="webintent"value="com.borismus.webintent.WebIntent"

我有 WebIntent.java 文件的正确 namespace 。

包 borismus.webintent;

我的 index.html 中引用了 webintent.js 文件。

下面是使用插件的函数。 函数 emailxmlfile(){

var subject = "Sports Code Xml Edit List" + filedate.toDateString();
var body = "";
if(!window.plugins || !window.plugins.webintent){

alert('Unable to find webintent plugin');

}else{



var extras={};

extras[WebIntent.EXTRA_SUBJECT] = subject;
extras[WebIntent.EXTRA_TEXT] = body;

window.plugins.webintent.startActivity({
action: WebIntent.ACTION_SEND,
type: 'text/plain',
extras: extras
}, function() {}, function(e) {alert('Failed to send email via Android Intent');});

}};

任何帮助将不胜感激。谢谢

最佳答案

我知道我可能会迟到,但是让您的相同代码在没有细微变化的情况下工作:在将插件详细信息添加到 .xml 文件时尊重大写。我的意思是,您是这样说的:

plugin name="webintent" value="com.borismus.webintent.WebIntent"

但是应该改为阅读此内容(注意名字!):

plugin name="WebIntent" value="com.borismus.webintent.WebIntent"

一旦您更正拼写错误,Eclipse 中的红色波浪线就会消失,并且代码工作正常,因此我可以从我的电子邮件应用程序中调用。

喂!

关于android - Phonegap 1.4.1 WebIntent 插件错误 "Class not found"Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9992433/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com