Search code examples
androidxamarin.androidnavigation-drawermaterialdrawer

Reload Activity on click on NavigationBar Back Button


I am using MikePenz Material Drawer to build a drawer in my xamarin application. So far it works great. URL : Material Drawer

All my activities are inherited from a BaseActivity, and within this base activity I have initiated the drawer plugin.

But, when I click on the back arrow in the toolbar, I need to reload the previous activity. At the moment it loads that activity but the data is not refreshed.

I have overriden the below method for the back button. But what I need to know is how can I start an activity depending on which page its called from.

public bool OnNavigationClickListener (View clickedView)
    {
        this.Finish();
        return true;
    }

Note : The above method is in the base activity.


Solution

  • You should update your logics in onResume() of previous activity.

    I am sure that onResume of the visible activity will be called.

    Cheers,
    Sha