当我的应用程序在后台运行很长时间时,我遇到了问题。单击应用程序后,我的活动将打开空白/空白,应用程序崩溃。如果Android系统不断破坏我的活动,我该如何开始我的活动?
我的活动的onCreate()
public new TableViewModel ViewModel
{
get { return (TableViewModel)base.ViewModel; }
set { base.ViewModel = value; }
}
protected override void OnViewModelSet()
{
base.OnViewModelSet();
SetContentView (Resource.Layout.SectorLayout);
}
protected override void OnCreate (Bundle savedInstanceState)
{
base.OnCreate (savedInstanceState);
//this.Intent.AddFlags (ActivityFlags.ClearTop | ActivityFlags.ClearTask | ActivityFlags.NewTask);
ActionBar.Title = Resources.GetString (Resource.String.tables);
_adapter = new MyPagerAdapter(SupportFragmentManager);
Pager = FindViewById<ViewPager> (Resource.Id.pager);
_tabs = FindViewById<PagerSlidingTabStrip> (Resource.Id.tabs);
Pager.Adapter = _adapter;
_tabs.SetViewPager (Pager);
var pageMargin = (int)TypedValue.ApplyDimension (ComplexUnitType.Dip, 4, Resources.DisplayMetrics);
Pager.PageMargin = pageMargin;
_tabs.OnTabReselectedListener = this;
}