Exported activity does not require permission

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.