Android implicit intents VS explicit intents

前端 未结 9 821
攒了一身酷
攒了一身酷 2020-12-04 16:30

Working with android I realized that implicit intents are good choice in most of cases due to their\'s flexibility. But what\'s about explicit intents? What are benefits of

9条回答
  •  不知归路
    2020-12-04 16:55

    Simply we can describe both intents like this...

    Explicit Intents: They are used for communication inside a particular application.

    eg: Consider an application that has a login page consisting of two Fields (say username and password).If both are true it will lead us to a page that displays the username field which we entered before. In this case, we use explicit intents because we need to change the activities and to carry data from one activity to the other activity(username field) in the same application.

    Implicit Intents: They are used for communication across two different applications.

    eg: consider an app that uses user's image from the camera as a profile picture. For this purpose, it uses Implicit Intent. It will call intent to camera application to get a picture from the it.

    I hope you can understand.

提交回复
热议问题