public void checkChildNotification() { int countNumberOfNotifications = 0; String numToString = ""; String user = BrainJuice.retrieveLoginUser(); BrainJuice.retrieveCNMgr().retrieveChildNotification(user); ArrayList<com.example.brainjuice.entity.ChildNotification> childNotificationList; childNotificationList = BrainJuice.retrieveCNMgr().retrieveChildNotification(user); for (com.example.brainjuice.entity.ChildNotification counter : childNotificationList) { 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); } }