Skip to content
Advertisement

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 BLE Scan Callback is not called after scanning for BLE devices

I’m creating an Android app that scans all nearby BLE (Bluetooth Low Energy) devices using Android Studio. I think I have implemented all these documentations: https://developer.android.com/guide/topics/connectivity/bluetooth/ble-overview https://developer.android.com/guide/topics/connectivity/bluetooth/permissions#java https://developer.android.com/guide/topics/connectivity/bluetooth/setup#java https://developer.android.com/guide/topics/connectivity/bluetooth/find-ble-devices But as you can see in the log below, (the problem) there are no BLE devices scanned by the app. Here are the logs in the logcat: I think it could

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_activity.xml recycler_style.xml Answer You mistype the recycler_style.xml, the id must

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 onDestroy()

Advertisement