Метод pop java.util.stack не работает в проекте xamarin android - PullRequest
0 голосов
/ 19 апреля 2019

Привет всем, я пытаюсь использовать Java.Util.Stack в своей деятельности в проекте xamarin android, но почему-то метод Pop () стека работает не так, как ожидалось, и stack.Peek () всегда показывает этот элемент вверх, который должен был быть удален после поп.Нужна помощь, поскольку я сбит с толку этим поведением

if (mStackFragments.Count > 1)
                {
                    if (mStackFragments.Peek() == explorerFragment) //this condition is evaluated to true and hence an item should be poped and lc is assigned that value too (confirmed by debugging)
                    {
                        int lc=(int)chapterStack.Pop();
                        int cnt=(int)chapterStack.Size();
                    }
                    mStackFragments.Pop();
                    SupportFragment frag = mStackFragments.Pop();
                    if (frag == chaptersFragment)
                    {
                        if (chapterfiltertext != "")
                        {
                            item.ExpandActionView();
                            sssearchview.SetQuery(chapterfiltertext, false);
                            mainview.Animate().Alpha(1f).SetListener(null);
                        }
                    }
                    if (frag == explorerFragment)
                    {
                        int pek = (int)chapterStack.Peek(); //always shows the item that should have been removed
                        chapterspinner.SetSelection((int)chapterStack.Peek());
                    }
                        ShowFragment(frag);
                }
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...