Skip to content

Instantly share code, notes, and snippets.

View balanza's full-sized avatar

Emanuele De Cupis balanza

View GitHub Profile
{"lastUpload":"2019-12-19T15:29:42.810Z","extensionVersion":"v3.4.3"}
@balanza
balanza / ti.android.events.js
Last active March 10, 2017 14:59 — forked from kristjanmik/ti.android.events.js
A proper way to handle pause and resume event in titanium for android
/**
* A little workaround to proper handle resume and paused events on Android
*/
var platformTools = require('bencoding.android.tools').createPlatform();
var wasInForeGround = true;
//to be executed on every activity staus change
//check if it's passing from foreground to background or viceversa
function checkStatusSwitch() {
var isInForeground = platformTools.isInForeground();