Don't remove this method. You just discovered a bug.

Move the contents of method onCreateOptionsMenu(...) into this one, everything in that method but super() and inflate().

The add the check of 'isShared' to hide the 'unshare' option when needed