I am trying to use Hyperloop to use the isCurrentActivityInForeground method inside org.appcelerator.titanium.TiApplication
I have tried the following and some other ways but I am unable to require the class - Any suggestions?
var TiApplicationClass = require('org.appcelerator.titanium.TiApplication');
var TiApplication = new TiApplicationClass;
var isInForeground = TiApplication.isCurrentActivityInForeground();
Ti.API.log("isInForeground");
Ti.API.log(isInForeground);
PS. I have asked in the slack channels multiple times but no help
I think benCoding.Android.Tools module is what you need: https://github.com/benbahrenburg/benCoding.Android.Tools
Sample code credits to Fokke Zandbergen: http://www.tidev.io/2014/01/28/paused-resumed-events-on-android/