Android: Firebase number increment
<p>I stuck at making an icrement of a value in Java with Firebase and the thing is it doesn't update a global variable. When I call an EventListener at onStart it successfully displays me the correct value of the variable(60). And when I want to increase it by 10 - with a button click - it displays me 0.</p>

<pre><code>long value;

@Override
protected void onStart() {
    super.onStart();

    final TextView mValue = (TextView) findViewById(R.id.some_textview);

    mRef = new Firebase(some_correct_url);
    mRef.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            value = (long) dataSnapshot.getValue();
            mValue.setText(value+"");
        }

        @Override
        public void onCancelled(FirebaseError firebaseError) {

        }
    });
}
</code></pre>

<p>And when a button is clicked the following function is being called</p>

<pre><code>public void addTen(View view) {
    mRef = new Firebase(my_private_url);
    mRef.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            value =(long) dataSnapshot.getValue();
            value = value + 10;
        }
        @Override
        public void onCancelled(FirebaseError firebaseError) {
        }
    });

    mRef.setValue(value);

}
</code></pre>

<p>So all in all the first part retrieves the correct value of the variable but the second part doesn't increase the correct value. Thanks in advance!</p>

<p>Edit: By the way I set the Firebase-rules as following:</p>

<pre><code>{
"rules": {
".read": "true",
".write": "true"
}
}
</code></pre>

<p>This is for the development time.</p>