This already works with the fragments and pages.

TO-DO
Add a progress bar, because when you press the scan contacts button, it freezes the app while it is reading the information from the phone, so it looks like as if the app has stop working.