il faudra que ServiceIntent(c'est la fonction qui lance un programme en tâche de fond ) se lance quand l'application est en background et s'arrête que l'application est en foreground
will require ServiceIntent (this is the function that launches a program in the background) starts when the application is in the background and stops the application is in foreground
var intent = Titanium.Android.createServiceIntent({ url: 'bgservice.js' }); intent.putExtra('interval', 60 * 1000);
function OnAppResume() { Titanium.Android.stopService(intent); }
function OnAppPause() { Titanium.Android.startService(intent); }
Ti.Android.currentActivity.addEventListener('resume', OnAppResume); Ti.Android.currentActivity.addEventListener('pause', OnAppPause);
please help me it's doesn't work