[Solved] Calculating sum of numbers from a file?
The answer to your problem with writing to the file is every time you are writing to the file you are over writing what was there before, what you need to do is change FileOutputStream fos = openFileOutput(“TotalSavings”, Context.MODE_PRIVATE) to: FileOutputStream fos = openFileOutput(“TotalSavings”, Context.MODE_PRIVATE | Context.MODE_APPEND) This tells android you want to append to … Read more