Skip to content

ДЗ по Activity 01#224

Open
mahonin-ms wants to merge 3 commits intoAndroid-Developer-Basic:homework/activity_01from
mahonin-ms:activity_01
Open

ДЗ по Activity 01#224
mahonin-ms wants to merge 3 commits intoAndroid-Developer-Basic:homework/activity_01from
mahonin-ms:activity_01

Conversation

@mahonin-ms
Copy link

No description provided.


buttonOpenView = findViewById<ViewGroup>(R.id.base).findViewById(R.id.button)
buttonOpenView.text = resources.getStringArray(R.array.open_buttons)[1] // Open Activity B
buttonOpenView.setOnClickListener {
Copy link

Choose a reason for hiding this comment

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

@mahonin-ms, тут надо еще подумать.
Задание:

По клику на кнопку “Open ActivityB” запустите ActivityB в отдельном стеке

А у вас и режим запуска стандартный и affinity нету - откроется в том же стеке


btn1 = findViewById<ViewGroup>(R.id.base_1).findViewById(R.id.button)
btn1.text = resources.getStringArray(R.array.open_buttons)[0] // Open Activity A
btn1.setOnClickListener { startActivity(Intent(this, ActivityA::class.java)) }
Copy link

Choose a reason for hiding this comment

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

@mahonin-ms, нужно еще подумать:

По клику на кнопку “Open ActivityA” запустите ActivityA, таким образом, чтобы мы попали на существующий экземпляр ActivityA и у него был вызван метод onNewIntent,

У вас режим запуска A - стандартный. Переопределите в ней onNewIntent для наглядности

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.

3 participants