简体   繁体   English

您是否在AndroidManifest.xml中声明了此活动? 登录活动

[英]Have you declared this activity in your AndroidManifest.xml ? LoginActivity

I keep getting this error even though my activity is in the android manifest file as the launcher. 即使我的活动作为启动器在android清单文件中,我仍会收到此错误。

Unable to find explicit activity class {com.alpha.hifivepro/com.alpha.hifivepro.activities.LoginActivity}; 无法找到明确的活动类{com.alpha.hifivepro / com.alpha.hifivepro.activities.LoginActivity}; have you declared this activity in your AndroidManifest.xml? 您是否在AndroidManifest.xml中声明了此活动?

And I am getting errors at these three locations. 我在这三个位置都遇到错误。 When the user clicks the logout button they are supposed to go to the loginactivity but I keep getting the above error. 当用户单击注销按钮时,他们应该进入loginactivity,但是我仍然收到上述错误。 Any help please ? 有什么帮助吗?

    private void handleLogout() {

        mAuth.signOut();
        SendUserToLoginActivity();

    }

    private void SendUserToLoginActivity() {

        Intent loginIntent = new Intent(MainActivity.this, LoginActivity.class);
        loginIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        startActivity(loginIntent);
    }

AndroidManifest.xml AndroidManifest.xml

    <application
        android:name=".utils.MyApp"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="false"
        android:theme="@style/AppTheme"
        tools:replace="android:supportsRtl,android:allowBackup">
        <activity android:name=".activities.authentication.RegisterActivity"></activity>
        <!--
             The API key for Google Maps-based APIs is defined as a string resource.
             (See the file "res/values/google_maps_api.xml").
             Note that the API key is linked to the encryption key used to sign the APK.
             You need a different API key for each encryption key, including the release key that is used to
             sign the APK for publishing.
             You can define the keys for the debug and release targets in src/debug/ and src/release/.
        -->
        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="@string/google_maps_key" />

        <activity
            android:name=".activities.PickPlaceMapsActivity"
            android:label="@string/title_activity_pick_place_maps" />
        <activity
            android:name=".activities.authentication.LoginActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

Your manifest has .activities.authentication.LoginActivity , but the error says .activities.LoginActivity . 您的清单具有.activities.authentication.LoginActivity ,但错误显示为.activities.LoginActivity You need to either correct your manifest to use the same package name or move LoginActivity to the authentication package. 您需要更正清单以使用相同的程序包名称,或将LoginActivity移至authentication程序包。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误您是否在 AndroidManifest.xml 中声明了此活动? - Error have you declared this activity in your AndroidManifest.xml? 屏幕锁定导致无法找到明确的活动类,您是否已在AndroidManifest.xml中声明了该活动? - Screen Locked causing Unable to find explicit activity class have you declared this activity in your AndroidManifest.xml? 无法找到显式活动类 {}; 您是否在 AndroidManifest.xml 中声明了此活动 - Unable to find explicit activity class {}; have you declared this activity in your AndroidManifest.xml 无法找到明确的活动类,是否已在AndroidManifest.xml中声明了该活动? - Unable to find explicit activity class have you declared this activity in your AndroidManifest.xml? 错误:您是否在 AndroidManifest.xml 中声明了此活动? 当试图意图上课时 - Error: have you declared this activity in your AndroidManifest.xml? when trying to intent a class android.content.ActivityNotFoundException:无法找到显式活动类; 您是否在 AndroidManifest.xml 中声明了此活动? - android.content.ActivityNotFoundException: Unable to find explicit activity class; have you declared this activity in your AndroidManifest.xml? 无法找到显式活动 class {}; 你有没有在你的 AndroidManifest.xml 地图中声明这个活动 API 不工作g;(Java ZE846DZDBC9AB870 - Unable to find explicit activity class {}; have you declared this activity in your AndroidManifest.xml Maps API not workingg ;( Java Android Studio? android.content.ActivityNotFoundException:无法找到显式活动 class {您是否在 AndroidManifest.xml 中声明了此活动? - android.content.ActivityNotFoundException: Unable to find explicit activity class { have you declared this activity in your AndroidManifest.xml? 活动“MainActivity”未在 AndroidManifest.xml 中声明,尽管它在那里 - The activity 'MainActivity' is not declared in AndroidManifest.xml although it is there 以编程方式检查是否在AndroidManifest.xml中声明了Activity - Programmatically check if an Activity is declared in the AndroidManifest.xml
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM