Skip to content

Tag: android-studio

OutputStreamWriter doesn’t rewrite file

I want to rewrite my JSON file with my edited jsonObj. When I set the 2nd parameter by the FileOutputStream to true, I get a output which is appended to the file. But I want to rewrite this, how can I do it? When I set the 2nd parameter to false, myReader is null and I don’t get a output.

Android RecyclerView on a null object reference

im trying to get Highscores from a File and display them in a RecyclerView. But im getting the following Error: I know that my scoreItems in arent empty. I dont know what i am doing wrong. I´m new in the Android World 🙂 Thanks for helping. My files: score_activity.java CustomAdapter.java activity_score_activi…

Call method when Application Closes

I know this is asked many times, but I want to clear things up In which activity should I place onDestroy()? Say I am in the MainActivity A and I move to activity B. But then I close the application while being on activity B. Does the onDestroy() method in MainActivity A get called? Or should I put an onDestr…