[퀵켓/사내세미나] android activity & task

20
Android Activity&Task 2014.0 9.24 ( ) 퀵켓 서비스개발부 한만종 [email protected]

Upload: chae-chul

Post on 02-Dec-2014

93 views

Category:

Engineering


2 download

DESCRIPTION

Android activity & Task

TRANSCRIPT

Android Activity&Task2014.09.24

!(주)퀵켓 서비스개발부 한만종

[email protected]

Index

1. Activity / Process Lifecycle

2. “launchMode” in AndroidManifest.xml

3. Tasks and Back Stack

Process Lifecycle

• Foreground: At the top of the screen, interacting with user

• Visible: Visible to the user, but not in the foreground

• Background: Not visible, paused

• Empty: hosting no activities or Service, BroadcastReceiver

Activity Lifecycle

android:launchModeAndroidManifest.xml

<activity

android:name=".activity.SMSReadActivity"

android:label="@string/setting_sms_read_title"

android:launchMode="singleTop" >

</activity>

android:launchMode

• “standard”

• “singleTop”

• “singleTask”

• “singleInstance”

can be instantiated multiple times.

can be held only one instance of activity.

android:launchMode

android:launchMode

android:launchMode• “singleTop”

android:launchMode• “singleTask”

android:launchMode• “singleTask”

android:launchMode• “singleInstance”

android:launchMode• “singleInstance”

Tasks and BackStack

Tasks and BackStack

Tasks and BackStack

Intent intent = new Intent(this, NewActivity.class);

intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

startActivity(intent);

Tasks and BackStack

• FLAG_ACTIVITY_SINGLE_TOP

• FLAG_ACTIVITY_NO_HISTORY

• FLAG_ACTIVITY_CLEAR_TOP

• FLAG_ACTIVITY_REORDER_TO_FRONT

Tasks and BackStack

Tasks and BackStack

감사합니다.

(주)퀵켓 서비스개발부 한만종 [email protected]