Skip to Content
안드로이드 멀티스레딩: 비동기 메커니즘으로 날렵하고 안정적인 앱 만들기
book

안드로이드 멀티스레딩: 비동기 메커니즘으로 날렵하고 안정적인 앱 만들기

by 한대희, 안데르스 예란손
April 2016
Beginner to intermediate
308 pages
7h 21m
Korean
Hanbit Media, Inc.
Content preview from 안드로이드 멀티스레딩: 비동기 메커니즘으로 날렵하고 안정적인 앱 만들기
256
2
-
비동기 기법
@
Override
protected void onHandleIntent
(
Intent intent
)
{
if
(
isNewNetworkDataAvailable
())
{
1
addStatusBarNotification
();
}
}
private boolean isNewNetworkDataAvailable
()
{
//
네트워크
요청
코드
생략됨
.
더미값을
반환한다
.
return true
;
}
private void addStatusBarNotification
()
{
Notification
.
Builder mBuilder
=
new Notification
.
Builder
(
this
)
.
setSmallIcon
(
R
.
drawable
.
new
_
data
_
available
)
.
setContentTitle
("
New network data
")
.
setContentText
("
New data can be downloaded
.");
NotificationManager mNotificationManager
=
(
NotificationManager
)
getSystemService
(
Context
.
NOTIFICATION
_
SERVICE
);
mNotificationManager
.
notify
(
1
,
mBuilder
.
build
());
}
}
1
네트워크 호출을 포함한다
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

코드로 인프라 관리하기: 효율적인 인프라 관리를 위한 자동화 방법

코드로 인프라 관리하기: 효율적인 인프라 관리를 위한 자동화 방법

강재준

Publisher Resources

ISBN: 9788968481703