Hello in my app I need to store single object with several fields. At this moment it is saved like this
@Override
public Object onRetainNonConfigurationInstance() {
return UILApplication.advert;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Advert retainedAdvert = (Advert) getLastNonConfigurationInstance();
if (retainedAdvert != null) {
UILApplication.advert = retainedAdvert;
}
}
Where UILApplication is singleton to keep advert. Sometimes ( often when call camera) advert object is erised to default. So i want to know about save and efficient way to kepp this object. Is it wise to store it in file/ serialise it or create database for a single record or there is something better?