public static void invalidateOptionsMenu(final Activity activity) {
        if (activity instanceof AppCompatActivity) {
            ((AppCompatActivity) activity).supportInvalidateOptionsMenu();
        } else {
            activity.invalidateOptionsMenu();
        }
    }
Show a short toast message to the user. This can be called from any thread.

@param activity the activity the user is facing
@param text     the message
main/src/main/java/cgeo/geocaching/activity/ActivityMixin.java