Problem:
After configuring activity in the Androidmanifest.xml file today, I was prompted to "exported activity does not require permission". The code I configured is as follows:
<ActivityAndroid:name= "Com.example.testmain.ShowActivity" > <Intent-filter> <ActionAndroid:name= "Test.update.mydata" /> <categoryAndroid:name= "My.test.show" /> </Intent-filter> </Activity>
Reason:
Check the information, originally because I configured the Activity <intent-filter> properties, configuration <intent-filter> Properties, it means that the activity can be used by other apps. But what about configuration <intent-filter> properties to prevent it from being used by other apps? There are two main solutions here!
The first type:
By adding the android:exported= "false" property. This property is used to indicate whether the service can be invoked or interacted with by other application components. If set to true, it can be called or interacted with, otherwise it cannot. When set to False, only the component of the same application or an application with the same user ID can start or bind the service.
<ActivityAndroid:name= "Com.example.testmain.ShowActivity"android:exported= "false" > <Intent-filter> <ActionAndroid:name= "Test.update.mydata" /> <categoryAndroid:name= "My.test.show" /> </Intent-filter> </Activity>
The second type:
control access to services from other apps by adding < permission> permissions!
Exported activity does not require permission