不幸的是,我的申请已停止

时间:2018-03-31 13:41:34

标签: android

  

03-31 21:26:47.921 21954-21954 / com.example.user.letseat E / AndroidRuntime:FATAL EXCEPTION:main                                                                             处理:com.example.user.letseat,PID:21954                                                                             android.content.ActivityNotFoundException:无法找到显式活动类{com.example.user.letseat / com.example.user.letseat.SignUp};你有没有在AndroidManifest.xml中声明这个活动?                                                                                 在android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1788)                                                                                 在android.app.Instrumentation.execStartActivity(Instrumentation.java:1512)                                                                                 在android.app.Activity.startActivityForResult(Activity.java:3873)                                                                                 在android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)                                                                                 在android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:67)                                                                                 在android.app.Activity.startActivityForResult(Activity.java:3824)                                                                                 在android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:720)                                                                                 在android.app.Activity.startActivity(Activity.java:4154)                                                                                 在android.app.Activity.startActivity(Activity.java:4122)                                                                                 at com.example.user.letseat.MainActivity $ 2.onClick(MainActivity.java:33)                                                                                 在android.view.View.performClick(View.java:4848)                                                                                 在android.view.View $ PerformClick.run(View.java:20262)                                                                                 在android.os.Handler.handleCallback(Handler.java:815)                                                                                 在android.os.Handler.dispatchMessage(Handler.java:104)                                                                                 在android.os.Looper.loop(Looper.java:194)                                                                                 在android.app.ActivityThread.main(ActivityThread.java:5631)                                                                                 at java.lang.reflect.Method.invoke(Native Method)                                                                                 在java.lang.reflect.Method.invoke(Method.java:372)                                                                                 在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:959)                                                                                 在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)

2 个答案:

答案 0 :(得分:0)

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

请在清单文件中声明您的活动,如下所示:

<activity
     android:name="com.example.package.YourActivityName"
     android:label="app_name" />

答案 1 :(得分:0)

您在SignUp文件中缺少AndroidManifest.xml条目,说明您获取

的原因
  

android.content.ActivityNotFoundException:无法找到显式   活动课   {com.example.user.letseat / com.example.user.letseat.SignUp};有你   在AndroidManifest.xml中声明了这个活动?

AndroidManifest.xml应用程序代码

中添加此行
<activity android:name=".SignUp"/>