0

Apologies if any of the terminologies i've used is incorrect, i'm currently doing an online learning course and still very new to java/Android development.

I'm trying to write a location recorder app that will save your route to a file. I've got an ArrayList of Location objects however I am unsure on how I can save the contents to to a file on the device

I've tried to serialise the Location objects however I get an '''java.io.NotSerializableException: android.location.Location''' error.

Any suggestions?

Decrypt3d
  • 1
  • 2
  • I am just importing the Location class using 'import android.location.Location;' – Decrypt3d Apr 20 '20 at 11:29
  • I think I'm a little out of my depth at the moment. Within my MainActivity.Java I import Location so I can use it. I dont have a public class like you mention. – Decrypt3d Apr 20 '20 at 11:50
  • Sorry, my bad. Location already implements `Parcelable` and you can find more information on how to serialize it in the answers to this question: [how to serialize for android.location class?](https://stackoverflow.com/questions/20121159/how-to-serialize-for-android-location-class) – razumichin Apr 20 '20 at 12:00

0 Answers0