Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use exported component properties

Shulou Source: shulou.com Published: 2022-06-03 11:02:13 11月15日 Update

Editor to share with you how to use exported component properties, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

What is exported?

Android:exported is one of the four components of Android, which is one of the four components of Activity,Service,Provider,Receiver.

Generally speaking, its main function is whether it supports other applications to call the current component.

Default value: if intent-filter is included, the default value is true; without intent-filter, the default value is false.

Exported component Properties

Let's take a closer look at this property in the component:

1. Let's take a look at: in Activity:

The meaning is as follows:

In Activity, this attribute is used to indicate whether the current Activity can be started by another Application component: true is allowed to be started; false is not allowed to be started.

If set to false, the Activity will only be called by the current Application or components that have the same userID.

The default value of exported depends on whether there is an intentfilter in the Activity. The absence of any filter means that the Activity cannot be awakened until its classname is described in detail. This means that the Activity can only be used within the application, because other application are not aware of the existence of the class. So in this case, its default value is false. On the other hand, if there is at least one filter in the Activity, it means that the Activity can be evoked externally by other applications, and its default value is true.

2. In Service:

...

The above is all the content of the article "how to use exported component properties". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Components attributes meaning articles applications content not much function on the other hand only most few overall situation meaning time more knowledge industry information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux OPPO Reno vpn macOS MariaDB