PR for code review

This process will create another MainActivity instance. I'm not sure what you're trying to achieve but if you just want to return to the previous screen (MainActivity) then you don't need to override this method.

By default onBackPressed will just call finish(), destroy the current activity and display the previous one