-1

每当我从 Android 工作室运行我的应用程序时,一个 Activity

android:exported="true"

启动而不是启动器活动

<activity
        android:name=".activity.SplashScreen"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:theme="@style/Theme.AppCompat.NoActionBar"
        android:windowSoftInputMode="stateHidden|adjustPan">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

但是一旦安装了应用程序,正确的启动器活动就会打开,没有问题。只有当我从 Android Studio 启动我的应用程序(即通过运行应用程序)时才会出现问题。那么为什么会发生这种情况呢?

如果没有android:exported="true",在某些设备上,单击我的应用程序通知后不会启动该活动。那么保持导出真实是否有益?

我也不能在这里发布我的整个清单

4

2 回答 2

0

从 Android Studio 运行应用程序时,您可能正在使用即时运行。它将代码更改应用到应用程序的当前运行进程,因此它不会再次安装应用程序,而是将新更改应用到正在运行的应用程序,在这种情况下,您会看到当前正在运行的活动。

http://android-developers.blogspot.com.eg/2016/04/android-studio-2-0.html https://developer.android.com/studio/run/index.html

于 2016-08-31T12:19:11.653 回答
-1

如果它只发生在 Android Studio 中而不是在安装应用程序时发生,则很可能是运行配置有问题。您可以访问它

运行 -> 编辑配置

于 2016-08-31T12:40:52.283 回答