01.11.2014 Views

The AndroidManifest.xml File - 안드로이드 기술 커뮤니티 : Korea ...

The AndroidManifest.xml File - 안드로이드 기술 커뮤니티 : Korea ...

The AndroidManifest.xml File - 안드로이드 기술 커뮤니티 : Korea ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

애플리케이션 개요 : Activities & Tasks (1강.review)<br />

Affinities and new tasks<br />

<strong>The</strong> FLAG_ACTIVITY_NEW_TASK flag<br />

As described earlier, a new activity is, by default, launched into the task of the activity<br />

that called startActivity(). It's pushed onto the same stack as the caller. However, if the<br />

Intent object passed to startActivity() contains the FLAG_ACTIVITY_NEW_TASK flag,<br />

the system looks for a different task to house the new activity. Often, as the name of<br />

the flag implies, it's a new task. However, it doesn't have to be. If there's already an<br />

existing task with the same affinity as the new activity, the activity is launched into that<br />

task. If not, it begins a new task.<br />

<strong>The</strong> allowTaskReparenting attribute<br />

If an activity has its allowTaskReparenting attribute set to "true", it can move from the<br />

task it starts in to the task it has an affinity for when that task comes to the fore. For<br />

example, suppose that an activity that reports weather conditions in selected cities is<br />

defined as part of a travel application. It has the same affinity as other activities in the<br />

same application (the default affinity) and it allows reparenting. One of your activities<br />

starts the weather reporter, so it initially belongs to the same task as your activity.<br />

However, when the travel application next comes forward, the weather reporter will be<br />

reassigned to and displayed with that task.<br />

<strong>Korea</strong> Android Community- www.kandroid.org<br />

107

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!