change code from onCreate to onResume so that it can be called every time
when we load the view