当我运行Android App Studio时,单元格是两次“安装”该应用程序:有两个应用程序,一个名为“SplashScreenActivity”,另一个名为“Doctor Quiz”(我的应用程序),两者相等。如果我卸载了一个,另一个也将卸载。为什么会这样?我该如何“安装”我的应用程序? (DoctorQuiz)
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.morais.daniela.doctorquiz" >
<uses-permission android:name="android.permission.INTERNET"/>
<provider android:authorities="com.facebook.app.FacebookContentProviderXXXX"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
<application
android:allowBackup="true"
android:icon="@drawable/medicine_box_icon2"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<activity
android:name=".Activity.SplashScreenActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_splash_screen"
android:theme="@style/FullscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Activity.QuestionsActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Activity.ResultActivity"
android:label="@string/title_activity_result" >
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:label="@string/app_name" />
</activity>
</application>
</manifest>
截屏
最佳答案
该应用未安装两次。您没有在查看应用程序。您正在查看可启动的 Activity ,带有以下<intent-filter>
的 Activity :
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
您使用
<intent-filter>
进行了两个 Activity ,因此在主屏幕启动器中将进行两个 Activity 。如果您不希望在主屏幕启动器中同时执行这两项 Activity ,请从其中一项中删除该<intent-filter>
。