Make it possible to remove categories in view mode

Categories could not be removed in view mode (just adding). Now, all
categories are removed before setting the selected.

Change-Id: I88e4cbe5e0c8db50d7388d14bedfd7ce215ad8b6
Merge "Make it possible to remove categories in view mode"