Answer the question
In order to leave comments, you need to log in
What is the best way to pass parameters to an activity?
When creating a new activity, you must pass your arguments to it. A similar question is described here, and as a solution two ways:
Answer the question
In order to leave comments, you need to log in
The first method using Intent is great, there is nothing to optimize here, the parameters are parsed in microseconds.
The second method uses the OOP paradigm, which in turn allows you to implicitly pass parameters, in my opinion this complicates the logic and debugging of the application.
for example, static newInstance for fragments has long become the standard,
so the rules of good manners require the second method, it is more correct because it allows you to hide serialization details (including keys by which parameters are passed), as well as control the number of parameters
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question