make it work with 2.9.1

change ctx.getContext() to cordova.getActivity()