如何缓存远程视图?

时间:2013-04-09 06:02:13

标签: android

我需要知道是否可以缓存布局远程视图?

如果是这样我如何缓存或清理缓存是否有任何示例在这里我试图谷歌它我找不到一个例子如何缓存布局远程视图

例如如何缓存此通知进度!

谢谢你的时间

      updateTask = this;

      //setup notification ID and information
      Random r = new Random();
      NOTIFICATION_ID  = r.nextInt(80-65) + 1;
      NOTIFICATION_ID++;

      int icon = R.drawable.icon;
      long when = System.currentTimeMillis();

      notification = new Notification(icon, getString(R.string.app_name), when);
      contentView = new RemoteViews(getPackageName(), R.layout.custom_notification);
      contentView.setTextViewText(R.id.text, "cool"+NOTIFICATION_ID);

      notification.contentView = contentView;

      notification.flags |= Notification.FLAG_NO_CLEAR;
      notification.flags |= Notification.FLAG_ONGOING_EVENT;



      Intent notificationIntent = new Intent();

      notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
      notificationIntent.setAction(Intent.ACTION_MAIN);
      PendingIntent contentIntent = PendingIntent.getActivity(BabupMain.this, 0, notificationIntent, 0);

      notification.contentIntent = contentIntent;


      mNotificationManager.notify(NOTIFICATION_ID, notification);

0 个答案:

没有答案