Fix problem for cnkb code invoked from background thread so 
getApplication() is null