当我在手机中启动应用程序时出现错误: -
这是Android studio中的错误
05-18 05:15:05.511 30559-30559/n3_x.a5seconds E/AndroidRuntime: FATAL EXCEPTION: main
Process: n3_x.a5seconds, PID: 30559
java.lang.RuntimeException: Unable to start activity ComponentInfo{n3_x.a5seconds/n3_x.a5seconds.Splashscreen}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3253)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
at android.app.ActivityThread.access$1100(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.util.AndroidRuntimeException: requestFeature() must be called before adding content
at com.android.internal.policy.PhoneWindow.requestFeature(PhoneWindow.java:398)
at android.app.Activity.requestWindowFeature(Activity.java:3993)
at n3_x.a5seconds.Splashscreen.onCreate(Splashscreen.java:28)
at android.app.Activity.performCreate(Activity.java:6876)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3206)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
at android.app.ActivityThread.access$1100(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
我的手机错误“不幸的是,AppName已停止”
注意:当我执行新的ImageButton
时,会出现此错误如果您有视频教程链接,请
感谢
答案 0 :(得分:0)
您的对话框中存在问题
public class MenuItem
{
public int Id { get; set; }
public bool Divider { get; set; }
public bool Header { get; set; }
public string ActionName { get; set; }
public string ControllerName { get; set; }
public string MenuItemText { get; set; }
public string Title { get; set; }
public IList<string> Roles { get; set; }
public int ParentId { get; set; }
}
var MenuList = new List<MenuItem>();
var menuItem = new MenuItem
{
Id = 1,
Divider = true,
Header = true,
ActionName = "Scheduling",
ControllerName = "Index",
MenuItemText = "sdfs",
Title = "Scheduling",
Roles = new List<string>{"rol1", "rol2"},
ParentId = 30
};
MenuList.Add(menuItem);