Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在通知android中添加路由图标_Android_Icons_Push Notification_Routes - Fatal编程技术网

如何在通知android中添加路由图标

如何在通知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

在“hereeeee”中,我需要放置一个路由,例如“/mnt/sdcard/Pou/4_1362782019815.png”

Thx.

尝试使用来建立通知,因为它使事情变得更方便,并且还有一种方法,您可以使用它传递任何您想要的位图(包括从SD卡加载的位图)。如果您需要以pre-Honeycomb为目标,支持库中还提供了从SD卡获取图标位图的功能:

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());