Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (evaljs)
Viewing all articles
Browse latest Browse all 83

evalJS() on app pause

$
0
0

Hi guys

I want to notify my WebView when the app enters the pause state.

First, I add an event listener in my app.js:

Ti.App.addEventListener( 'pause', function() {

myWebView.evalJS( 'pause()' ); // doesn't work

});

My pause() function never gets fired.

It works great with resume:

Ti.App.addEventListener( 'resume', function() {

myWebView.evalJS( 'resume()' ); // works

});

I also tried to add the pause event listener directly in my WebView without any luck.

Can anyone think of a smarter solution?


Viewing all articles
Browse latest Browse all 83

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>