1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | private void connectPush(String title, String text) { NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); NotificationCompat.Builder builder = new NotificationCompat.Builder(this) .setContentTitle("난제목이야") //기어핏에 나타낼 제목 .setContentText("난내용이구") //기어핏에 나타낼 내용 // .setTicker("one line msg.") .setSmallIcon(R.mipmap.ic_launcher) //기어핏에 나타낼 AppIcon .setAutoCancel(true) .setWhen(System.currentTimeMillis()) .setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE | Notification.DEFAULT_LIGHTS); Notification n = builder.build(); n.defaults = Notification.DEFAULT_LIGHTS; //디바이스 진동 없애기. nm.notify(1000, n); } | cs |
'개발 Story > 안드로이드' 카테고리의 다른 글
[안드로이드] UncaughtExceptionHandler/비정상 종료 (로그)처리하기 (0) | 2015.12.14 |
---|---|
[안드로이드] app lucher/ 앱 런처로 이용하기 (0) | 2015.12.14 |
[안드로이드]뒤로가기시 alert 경고창, 종료여부 확인하기 (0) | 2015.12.14 |
[안드로이드] 앱(어플) 버전 구하기 (0) | 2015.11.20 |
[안드로이드] 웹서버 XML 파싱하기 (0) | 2015.10.13 |