Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Домашняя работа по активити 1 задача #45

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Galinnka
Copy link

Здравствуйте! Из всех задач у меня почему-то не получилось во 2й задаче 6я подзадача, там вроде как должно использоваться finishAffinity(), но он у меня стек не закрывает уже по всякому делала и я не смогла до конца решить что не так не пойму.

<activity
android:name=".ActivityA"
android:exported="true"
android:launchMode="standard"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Galinnka , тут у вас неверный режим активити. Не выполняется задание 2.3, а создается новый экземпляр

finish()
}
buttonS.setOnClickListener {
finishAffinity()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Galinnka , тут все верно. Стек закрывается и попадаем обратно на А. Если вам кажется, что он не закрылся потому, что торчит в последних запущенных программах - то это норм. потому что это список ПОСЛЕДНИХ ЗАПУЩЕННЫХ, а не тех, что сейчас в памяти

<activity
android:name=".ActivityD"
android:label="ActivityD"
android:launchMode="singleTask"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Galinnka , зачем вам тут сингл-таск? Вы все верно флажками разрулили в создании интентов!

<activity
android:name=".ActivityC"
android:label="ActivityC"
android:launchMode="singleTop"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Galinnka , поясните, пожалуйста, зачем вам сингл-топ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants