Java answers fine, I tend to use C# for Android.
In my ActivityGroup I have this method which starts and shows a child activity:
public void StartChildActivity (string Id, Intent intent)
{
intent.AddFlags (ActivityFlags.ClearTop);
Window window = LocalActivityManager.StartActivity (Id, intent);
if (window != null)
{
mIdList.Add (Id);
SetContentView (window.DecorView);
}
}
However, when I handle the back button to "pop" off a view and return it to the previous one, the app closes when finish is called:
public override void OnBackPressed ()
{
int length = mIdList.Count;
if (length > 1)
{
Activity current = LocalActivityManager.GetActivity (mIdList [length - 1]);
current.Finish();
}
}
How do I get the view to "pop" instead of shut down the app?