I've come across with a problem that has to be really common on Android or any mobile platform. Let's say I have a list of custom objects (e.g. User, Event). I don't know how many items are there in the list. What I need is how do I edit these objects on another screen (layout) and then return the object back to the list. I thought of a few solutions for this, none of them seem to me as clean though:
- Use
SetContentView()
- handling which object is being edited and returning it to the list is easy, but I'd have to setup the main screen every time the object is edited, pressing back action would have to be overwritten. - use another activity- this seems a clean solution, no problems with setting layout, but data handling is the problem- I don't know how to pass the object to another activity and return it back afterwards. I could use a static class to handle this for me, but it doesn't look as a way it's meant to be done.
I hope I didn't confuse you, so to clarify it you can imagine it as editing an event in Google calendar. Please note that I'm a beginner and I use Xamarin.Android.