警告:导出活动不需要权限

时间:2021-02-14 23:19:42

I recently created a project and added a splash and a main activity. I edited the manifest file and added the splash activity and the main activity in to it. After adding the main activity, it gives me a warning "Exported Activity Does not Require Permission". What is this warning that it gives me? my API version is android:15.

我最近创建了一个项目,并添加了一个启动和一个主要活动。我编辑了清单文件,并在其中添加了启动活动和主要活动。在添加了主活动之后,它给我一个警告“导出活动不需要权限”。它给我的警告是什么?我的API版本是android:15。

Please help, Thank you!

请帮助,谢谢!

this is my manifest file!

这是我的舱单文件!

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sliit.droidman"
android:versionCode="1"
android:versionName="1.0">

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15" />

<application android:label="@string/app_name"
    android:icon="@drawable/ic_launcher"
    android:theme="@style/AppTheme">
    <activity
        android:name=".SplashActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>        
    <activity
        android:name="com.sliit.droidman.main.MainActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="com.sliit.droidman.main.MAINACTIVITY" />
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>
</application>

</manifest>

3 个解决方案

#1


26  

It could be due to the <action android:name="com.sliit.droidman.main.MAINACTIVITY" />. I don't know why you add that intent filter?

可能是因为 。我不知道你为什么要添加意图过滤器?

You normally don't need an intent-filter for other normal activities.

您通常不需要为其他正常活动设置意图过滤器。

#2


75  

add this to your activity definition

将其添加到活动定义中

android:exported="false"

#3


30  

This warning means that your activities are exposed to different-process apps that might instantiate them without any required permission.

这个警告意味着您的活动暴露在不同的进程应用程序中,这些应用程序可能在不需要任何必要权限的情况下实例化它们。

for details see: http://developer.android.com/guide/topics/manifest/activity-element.html http://developer.android.com/guide/topics/manifest/activity-element.html#prmsn

详情请参阅:http://developer.android.com/guide/topics/manifest/activity-element.html http://developer.android.com/guide/topics/manifest/activity-element.html#prmsn

#1


26  

It could be due to the <action android:name="com.sliit.droidman.main.MAINACTIVITY" />. I don't know why you add that intent filter?

可能是因为 。我不知道你为什么要添加意图过滤器?

You normally don't need an intent-filter for other normal activities.

您通常不需要为其他正常活动设置意图过滤器。

#2


75  

add this to your activity definition

将其添加到活动定义中

android:exported="false"

#3


30  

This warning means that your activities are exposed to different-process apps that might instantiate them without any required permission.

这个警告意味着您的活动暴露在不同的进程应用程序中,这些应用程序可能在不需要任何必要权限的情况下实例化它们。

for details see: http://developer.android.com/guide/topics/manifest/activity-element.html http://developer.android.com/guide/topics/manifest/activity-element.html#prmsn

详情请参阅:http://developer.android.com/guide/topics/manifest/activity-element.html http://developer.android.com/guide/topics/manifest/activity-element.html#prmsn