Skip to content

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

Open
Galinnka wants to merge 7 commits intoOtus-Android:masterfrom
Galinnka:master
Open

Домашняя работа по активити 1 задача#45
Galinnka wants to merge 7 commits intoOtus-Android:masterfrom
Galinnka:master

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

Comments