2012년 9월 5일 수요일
패턴 코드) Android Notification Bar creation.
노티 피케이션바 사용법
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager)getSystemService(ns);
서비스 받아 온다.
mNotificationManager.cancel(id);
원래 있던 애는 캔슬 <이게 캔슬하는 API>
요 부분이
Intent intent = new Intent(getApplicationContext(), HelloWorld.class);
intent.putExtra(IS_FROM_NOTIFICATION_BAR, true);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification notification = new Notification(getApplicationContext(), R.drawable.sys, getApplicationContext().getResources()
.getString(R.string.download_completed), System.currentTimeMillis(), getApplicationContext().getResources().getString(
R.string.download_completed), "HelloWorld", intent);
notification.contentView = new RemoteViews(getApplicationContext().getPackageName(), R.layout.download_completed);
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.contentIntent = pendingIntent;
mNotificationManager.notify(PRGS_NUM+(int)9999, notification);
만들어서 쏘는 것 까지
이 패턴만 여러번 봐서 익히면 노티바는 무척 쉽다.
코드도 역시 패턴.
이 패턴이 그 패턴은 아니지만.
피드 구독하기:
댓글 (Atom)
UPBIT is a South Korean company, and people died of suicide cause of coin investment.
UPBIT is a South Korean company, and people died of suicide cause of coin. The company helps the people who control the market price manipu...
-
[펌] [UNIX/LINUX 명령어] apropos linux 2005/06/28 22:05 수정 삭제 http://blog.naver.com/wiggyz/80014482910 Mr.You의 블로그 | ?? http:...
-
비주얼 라우터나 슈퍼스캔만 있으면 간단하지만... 이런 방법도 있습니다. ----------- 아피추적법입니다.. Mirc에서 IP알아오기 Ip를 알아내고 싶은 사람의 닉을.,채팅 창에서 그냥 이렇게 쓰고 엔터한다!...
-
SELinux 불린 값을 이용해서 SELinux.getBooleanValue("xxxx") SELinux.setBooleanValue("xxxx", yyyy); Policy 에도 if 문을 줄...
댓글 없음:
댓글 쓰기
국정원의 댓글 공작을 지탄합니다.