Hi The above error occurs when I do the following.
I have a text file with multiple lines of data. Within my application I come across the need to replace a line from the file with a new one. I am using BufferedReader with a fixed size (50k) to read the file into as below: FileReader input_redo = new FileReader(redo); BufferedReader reader = new BufferedReader(input_redo); String line = "", oldtext = ""; while((line = reader.readLine()) != null) { oldtext += line + "\r\n"; } reader.close(); String newtext = oldtext.replaceAll("Hello how are you", "Have I met you before?"); FileWriter writer = new FileWriter("/sdcard/data/replace.txt"); writer.write(newtext); writer.close(); Could anyone please help me out with this error? I know the device is running out of memory bcoz of the buffer size or something but don't know a work around for this. Please help Abhi -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en