Handle cases when getCurrentActivity() returns null