Load previous page on app start

Pls how do I load the previous page the app is on b4 it was closed or for android, when ever you are viewing a page on any app and u mimimize the app to do something else when ever you come back to that app it refreshes. So my question is, how can I make my app remember the last page that was open b4 it refreshed so it can open that same page on app ready state.

In app.ts, there is

rootPage: any = SomePageComponent

change it to

rootPage: any 

then in constructor (platform: Platform) {
  platform.ready().then(
    () => {
      this.rootPage = localStorage.LastPage;
    }
  );
}

whenever a page component is activated, do localStorage.LastPage = ThisPageComponent

I shouldn’t use localStorage though, use http://ionicframework.com/docs/v2/api/platform/storage/LocalStorage/

Thank you so much, you just saved my life…

please am having issues with (ThisPageComponent), please can you throw more light on how to do that cos its showing me error.