如何在通知android中添加路由图标
在“hereeeee”中,我需要放置一个路由,例如“/mnt/sdcard/Pou/4_1362782019815.png” Thx.尝试使用来建立通知,因为它使事情变得更方便,并且还有一种方法,您可以使用它传递任何您想要的位图(包括从SD卡加载的位图)。如果您需要以pre-Honeycomb为目标,支持库中还提供了从SD卡获取图标位图的功能:如何在通知android中添加路由图标,android,icons,push-notification,routes,Android,Icons,Push Notification,Routes,在“hereeeee”中,我需要放置一个路由,例如“/mnt/sdcard/Pou/4_1362782019815.png” Thx.尝试使用来建立通知,因为它使事情变得更方便,并且还有一种方法,您可以使用它传递任何您想要的位图(包括从SD卡加载的位图)。如果您需要以pre-Honeycomb为目标,支持库中还提供了从SD卡获取图标位图的功能: private void showNotification() { NotificationManager mNotificationMana
private void showNotification() {
NotificationManager mNotificationManager = (NotificationManager)getApplicationContext().getSystemService(Context.NOTIFICATION_SERVICE);
Notification notifyDetails = new Notification(R.drawable.alert_light_frame,"Alarma!",System.currentTimeMillis());
PendingIntent myIntent = PendingIntent.getActivity(getApplicationContext(), 0, new Intent(Intent.ACTION_VIEW, People.CONTENT_URI), 0);
notifyDetails.setLatestEventInfo(getApplicationContext(), "Alarma!", nombre, myIntent);
notifyDetails.flags |= Notification.FLAG_AUTO_CANCEL;
notifyDetails.icon |= HEREEEEEEEEEEE
mNotificationManager.notify(SIMPLE_NOTFICATION_ID++, notifyDetails);
Log.i(getClass().getSimpleName(),"Sucessfully Changed Time");
}
2) 设置用于通知的位图
File f = new File("/mnt/sdcard/photo.jpg");
Bitmap notificationIconBmp = BitmapFactory.decodeFile(f.getAbsolutePath());
NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
builder.setLargeIcon(notificationIconBmp);
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
nm.notify("direct_tag", NOTIF_ALERTA_ID, builder.build());