Refactored code to load a dialogfragment on option menu press.