gpt4 book ai didi

java - 您是否在 AndroidManifest.xml 中声明了此 Activity ?登录 Activity

转载 作者:行者123 更新时间:2023-12-02 01:23:05 27 4
gpt4 key购买 nike

即使我的 Activity 作为启动器位于 Android list 文件中,我仍然收到此错误。

Unable to find explicit activity class {com.alpha.hifivepro/com.alpha.hifivepro.activities.LoginActivity}; have you declared this activity in your AndroidManifest.xml?

我在这三个位置遇到错误。当用户单击注销按钮时,他们应该进入登录 Activity ,但我不断收到上述错误。有什么帮助吗?

    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

    <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>

最佳答案

您的 list 具有 .activities.authentication.LoginActivity,但错误显示 .activities.LoginActivity。您需要更正 list 以使用相同的包名称,或者将 LoginActivity 移至 authentication 包。

关于java - 您是否在 AndroidManifest.xml 中声明了此 Activity ?登录 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57343779/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com