读书人

android 发送揭示消息

发布时间: 2012-11-16 14:12:14 作者: rapoo

android 发送提示消息

NotificationManager notificationManager    = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); notification.defaults = Notification.DEFAULT_LIGHTS;          notification.icon = R.drawable.ic_action_search ;                  notification.flags |= Notification.FLAG_AUTO_CANCEL;         notification.when = System.currentTimeMillis();         notification.tickerText = message;  // 弹出消息提示信息Intent in = new Intent(context,                 Test.class);         PendingIntent contentIntent = PendingIntent.getActivity(context, 0,                 in, PendingIntent.FLAG_UPDATE_CURRENT);         notification.setLatestEventInfo(context, "0.0.", message,                 contentIntent);         notificationManager.notify(new Random().nextInt(), notification);

?

读书人网 >Android

热点推荐