android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.elect

错误

android 项目开发
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.elect
具体的

2022-08-27 23:07:11.526 22111-22111/com.example.electronicmall E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.electronicmall, PID: 22111
    android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.electronicmall/com.example.electronicmall.test.User.UserPasswordRetrievalCompletedActivity}; have you declared this activity in your AndroidManifest.xml?
        at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2118)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1746)
        at android.app.Activity.startActivityForResult(Activity.java:5412)
        at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:574)
        at android.app.Activity.startActivityForResult(Activity.java:5337)
        at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:560)
        at android.app.Activity.startActivity(Activity.java:5819)
        at android.app.Activity.startActivity(Activity.java:5787)
        at com.example.electronicmall.test.User.UserResetPasswordActivity.openUserPasswordRetrievalCompletedActivity(UserResetPasswordActivity.java:65)
        at com.example.electronicmall.test.User.UserResetPasswordActivity.access$400(UserResetPasswordActivity.java:18)
        at com.example.electronicmall.test.User.UserResetPasswordActivity$3.onClick(UserResetPasswordActivity.java:53)
        at android.view.View.performClick(View.java:7317)
        at android.view.View.performClickInternal(View.java:7291)
        at android.view.View.access$3600(View.java:838)
        at android.view.View$PerformClick.run(View.java:28247)
        at android.os.Handler.handleCallback(Handler.java:900)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:219)
        at android.app.ActivityThread.main(ActivityThread.java:8668)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)

解决

在AndroidManifest.xml文件的application中, 添加

<activity
            android:name="Activity所处位置"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar" />

原因

由于程序无法自动识别Activity, 因此需要在AndroidManifest.xml文件的application中进行配置, 使程序可以识别该Activity

原创不易
转载请标明出处
如果对你有所帮助 别忘啦点赞支持哈
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

飞滕人生TYF

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值