//Android API 15 ↑
IssueListActivity act = AActivity.this; NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com")); PendingIntent pendingIntent = PendingIntent.getActivity(act, 0, i, 0); Notification.Builder mBuilder = new Notification.Builder(act); mBuilder.setSmallIcon(R.drawable.icon); mBuilder.setTicker("Hello Notification"); mBuilder.setWhen(System.currentTimeMillis()); mBuilder.setNumber(10); mBuilder.setContentTitle("title"); mBuilder.setContentText("content msg"); mBuilder.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE); mBuilder.setContentIntent(pendingIntent); mBuilder.setAutoCancel(true); nm.notify(1, mBuilder.getNotification());
댓글
댓글 쓰기