Solved bug caused when the SettingsActivity performed the back press it created another activity duplicating the Mainactivity in the BackStack.