Esempio n. 1
0
  public void checkNotification() {
    int countNumberOfNotifications = 0;
    String numToString = "";
    String user = BrainJuice.retrieveLoginUser();
    BrainJuice.retrieveANMgr().retrieveAdultNotification(user);
    ArrayList<com.example.brainjuice.entity.AdultNotification> adultNotificationList;
    adultNotificationList = BrainJuice.retrieveANMgr().retrieveAdultNotification(user);
    for (com.example.brainjuice.entity.AdultNotification counter : adultNotificationList) {
      countNumberOfNotifications++;
    }
    numToString = Integer.toString(countNumberOfNotifications);

    if (countNumberOfNotifications <= 0) {
      textView = (TextView) findViewById(R.id.count);
      textView.setBackgroundResource(R.drawable.blank);
      notificationCount = (TextView) this.findViewById(R.id.count);
      notificationCount.setText("");
    } else {
      textView = (TextView) findViewById(R.id.count);
      textView.setBackgroundResource(R.drawable.notificationred);
      notificationCount = (TextView) this.findViewById(R.id.count);
      notificationCount.setText(numToString);
    }
  }