【问题标题】:Phonegap 3.0, Android - On invocation of WebIntent plugin, getting Class not found exceptionPhonegap 3.0,Android - 在调用 WebIntent 插件时,出现 Class not found 异常
【发布时间】:2013-09-27 09:14:55
【问题描述】:

我正在使用 Phonegap 3.0。我已包含在 config.xml 中: gap:plugin name="com.borismus.webintent

在 index.html 脚本中 type="text/javascript" src="webintent.js"

我收到错误消息 - “邮件表单:通过 Android Intent 发送邮件失败:找不到类” 在 Android 中运行时

下面是代码:

var extras = {};
extras[window.plugins.webintent.EXTRA_EMAIL] =   "vidya.narasimhan@merceworld.com";
extras[window.plugins.webintent.EXTRA_TEXT] = "hello testing";
console.log('Mail Form: starting webintent activity  ');
window.plugins.webintent.startActivity(
     { 
            action: window.plugins.webintent.ACTION_SEND,
            type: 'application/octet-stream', 
            extras: extras 
     }, 
     function() {
            console.log('Mail Form: sendMail success via Android Intent');
     }, 
     function(e) {
            console.log('Mail Form: sendMail failed via Android Intent:' + e);
     }

);

请帮忙

【问题讨论】:

    标签: cordova webintents


    【解决方案1】:

    我使用 FileOpener 而不是 WebIntent。

    don 的 FileOpener 版本已在我的应用程序 cordova 3.0 上运行

    phonegap local plugin add https://github.com/don/FileOpener
    

    所有的 xmls、插件等都会自动添加。

    在 index.html 上添加了 fileopener.js 然后

    window.plugins.fileOpener.open( path );
    

    【讨论】:

      【解决方案2】:

      有时,您的 webintent 将在 android 模拟器或设备上正常工作,但当您在 ​​phonegap 应用上使用 serve 检查时可能会收到此错误。在设备或模拟器上检查一次!

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2018-08-22
        • 1970-01-01
        • 2019-12-12
        • 2013-03-01
        • 2018-10-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多