I was asked the following question in an interview :
Why do we need Intents to start new Activity or Service? Alternatively, why don't we start Activity by creating a new object and calling activity_obj.onCreate(..); on it.
I could count the benefits of intents like transferring data and intent-filters targeting appropriate activities, but except that I couldn't come up with a satisfying answer.
Is it related to life cycle callback handling of Activities ? I can't find a good answer anywhere. Please suggest!!
Aucun commentaire:
Enregistrer un commentaire