알림 예제(Notification Example)
버튼 누르면 toast 메시지가 뜨고 진동과 함께 상태창에 알림이 온다.
상태창의 알림을 터치하면 SubActivity가 호출된다.
activity_main.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
MainActivity.java
package com.notificationexample.mystoryg.notificationexample;
|
activity_sub.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
SubActivity.java
package com.notificationexample.mystoryg.notificationexample;
|
'프로그래밍 > Android' 카테고리의 다른 글
Preference Example (0) | 2017.01.10 |
---|---|
알람 예제 (AlarmManager Example) (0) | 2016.12.22 |
브로드캐스트 리시버 (BroadcastReceiver Example) (0) | 2016.12.20 |
Service Example (0) | 2016.12.17 |
명시적 인텐트(Explicit Intent) (0) | 2016.12.16 |
암시적 인텐트(Implicit Intent) (0) | 2016.12.15 |
WebView 줄바꿈 문제 (0) | 2016.02.18 |