eeadev
eeadev

Reputation: 3852

How to solve "exception firing resume/pause event from native" Cordova Android

My android phonegap/cordova application keeps getting this message:

"exception firing resume/pause event from native"

It appears in my logcat

I/chromium(22500): [INFO:CONSOLE(1)] "exception firing pause event from native", source: file:///android_asset/www/login_page.html (1)

and these are the first 4 lines of login_page.html:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />

I am using cordova 3.5 and JQueryMobile. Though my application is still working, what is the reason/meaning of this exception?

Upvotes: 1

Views: 2570

Answers (1)

mvermand
mvermand

Reputation: 6137

Are you sure you added the cordova.js to your scripts in your login_page.html?

When the android app receives a 'pause' event, the following code is issues:

this.loadUrl("javascript:try{cordova.fireDocumentEvent('pause');}catch(e){console.log('exception firing pause event from native');};");

So, it is probably related to the absence of variable cordova in the context. Adding cordova.js will put variable cordova in the context and cordova.fireDocumentEvent will be there, avoiding the exception.

Upvotes: 4

Related Questions