Reputation: 194
int percentint=(vdcostint/b1txtaint)*100;
-------vdcostint is a value retrieved from firebase and b1txtaint is another value from different key---
But I am unable to use two values outside onDataChange.
Upvotes: 0
Views: 75
Reputation: 384
The values you obtain inside onDataChange() are not available outside the method. To use the data outside those values you need to call a function from inside of the onDataChange() and do the calculations there.
Upvotes: 1