Implicit intent - When we want to call the system components through intent to perform a particular task and we don't really know the name of the components to be used, the android system will show the desired list of applications to perform the task.
示例: 您有一个列表活动,当您单击列表中的一个项目时,它会打开一个详细信息活动。在这种情况下,您的 知道,该项目的细节可以显示或处理的 DetailActivity.class的应用程序。
So to perform this action you create an Intent by explicitly specifying the class name.
Intent showDeatil = new Intent(this,DetaiActivy.class);
startActivity(showDeatil);
内隐意图 :
当您不知道哪个应用程序的哪个活动可以处理您的请求时,使用隐式意图。
你有一个链接。当你点击这个链接时,它应该会在某个浏览器中打开这个网页。应用程序可以处理您的请求的确切活动是 不知道。你只是有一个模糊的想法,这是一个网页链接,所以它应该打开一个网页在某些浏览器,当有人打开它。在这种情况下,您只需指定 ACTION,然后由 OS 来处理其余的事情。
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
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.