0

I came from asp.net MVC and have an application with multiple views and a controller. In this controller I have to transfer my object from one view to another (several times) Is it possible to do "the same thing" with Android (Java)?

For example In my application I have to unload a package from a truck. Before I can do that, my API is asking me to enter my location. So I would open my UI mask to enter the location Press "OK" and go back to my Unload UI mask if necessary.

I thought of something like startActivity and when I'm done with it close it and switch to the next activity.

My goal is to keep updating the object until the API can satisfy it

Alex
  • 1
  • 2
  • quite hard to understand what you're asking, at least personally, but yes, android does have ways of dealing with passing data around. simplest and most basic approach would be static, right ? – a_local_nobody Nov 26 '21 at 15:06
  • Sorry i try to give more information. I click on a button and and make a API Request, parse my response to an object and have a property gotoAction. This is a enum of possible 14 Actions. Now i need handle this goToAction, start another activity but dont want loose my model / object because of further information i collect in this model. – Alex Nov 26 '21 at 15:28
  • Does this answer your question? [How do I pass data between Activities in Android application?](https://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android-application) – a_local_nobody Nov 26 '21 at 15:39
  • yes that helps, but isn't it bad to open and close an activity because of the ActivityLifeCycle? – Alex Nov 29 '21 at 08:40
  • why would it be bad ? if you don't want to several activities, then just use one with several fragments – a_local_nobody Nov 29 '21 at 08:41
  • So it has no effect on performance if I have a lot of activity and change them often? For example my WebApplication with several Views nested in a Controller. https://i.imgur.com/oDuTfoO.png – Alex Nov 29 '21 at 08:51
  • everything we do has an impact on performance, whether or not it has enough of an impact to make a difference, that's harder to answer. trying to solve a problem which might not exist isn't ideal, so i suggest just doing whatever you know how to do and then see what happens. if you end up with an actual issue, it's easier to ask here for why it happens, instead of having this discussion of trying to relate web concepts to mobile concepts – a_local_nobody Nov 29 '21 at 09:03
  • Thanks for the help I will try my first Android app – Alex Nov 29 '21 at 09:28

0 Answers0