Fix for #981 when the android framework returns NULL for getActivity()
return immediately if the activity is null
Merge pull request #994 from crankycoder/features/981-getactivity-npe

Fix for #981 when the android framework returns NULL for getActivity()