Android应用程序关闭但未打开

时间:2019-12-29 16:06:41

标签: java android

我正在看Logcat,但是我找不到问题所在。我正在尝试设计用户登录页面,但是应用程序在打开之前就关闭了。我不知道是什么问题。没有错误警告。

  

2019-12-29 19:14:31.981 2076-2165 / ceyizci.com.android E / AwareLog:AtomicFileUtils:readFileLines文件不存在:android.util.AtomicFile@f64d785   2019-12-29 19:14:31.982 2076-2165 / ceyizci.com.android E / AwareLog:AtomicFileUtils:readFileLines文件不存在:android.util.AtomicFile@d7879da   2019-12-29 19:14:32.089 2076-2115 / ceyizci.com.android E / MemoryLeakMonitorManager:MemoryLeakMonitor.jar不存在!   2019-12-29 19:14:32.530 2076-2076 / ceyizci.com.android E / AndroidRuntime:FATAL EXCEPTION:main       流程:ceyizci.com.android,PID:2076       java.lang.RuntimeException:无法启动活动ComponentInfo {ceyizci.com.android/ceyizci.com.android.LoginActivity}:android.util.AndroidRuntimeException:添加内容前必须调用requestFeature()           在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3430)           在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)           在android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)           在android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)           在android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)           在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:2199)           在android.os.Handler.dispatchMessage(Handler.java:112)           在android.os.Looper.loop(Looper.java:216)           在android.app.ActivityThread.main(ActivityThread.java:7625)           在java.lang.reflect.Method.invoke(本机方法)           在com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java:524)           在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)        由以下原因引起:android.util.AndroidRuntimeException:在添加内容之前必须调用requestFeature()           在com.android.internal.policy.PhoneWindow.requestFeature(PhoneWindow.java:421)           在android.app.Activity.requestWindowFeature(Activity.java:4490)           在ceyizci.com.android.LoginActivity.onCreate(LoginActivity.java:33)           在android.app.Activity.performCreate(Activity.java:7458)           在android.app.Activity.performCreate(Activity.java:7448)           在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286)           在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409)           在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)           在android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)           在android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)           在android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)           在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:2199)           在android.os.Handler.dispatchMessage(Handler.java:112)           在android.os.Looper.loop(Looper.java:216)           在android.app.ActivityThread.main(ActivityThread.java:7625)           在java.lang.reflect.Method.invoke(本机方法)           在com.android.internal.os.RuntimeInit $ MethodAndArgsCaller.run(RuntimeInit.java:524)           com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)

1 个答案:

答案 0 :(得分:0)

“添加内容之前必须先调用requestFeature()”

调用setContentView后不能调用requestFeature。您必须先这样做。