Code example for BlockingQueue

Methods: add, size

0
    public boolean onUnbind(Intent intent) {
        return false; 
    } 
 
    public void uploadStatRecord(StatRecord record) {
        int size = statQueue.size();
        statQueue.add(record);
        startForeground(notifyId, getNotification(size + 1));
    } 
 
    public void setOnStatRefreshListener(OnStatRefreshListener listener) {
        this.listener = listener;
    } 
 
    @Override 
    public void onCreate() { 
        if (svc == null) {
            SharedPreferences prefs = getSharedPreferences("prefs", MODE_PRIVATE);
            svc = new RallyWebService(
                    getString(R.string.wsRootUrl),
                    prefs.getString("login", ""),