If you run Android, it keeps shutting down android.widget.Button cannot be cast to android.view.ViewGroup

Asked 2 years ago, Updated 2 years ago, 56 views

It keeps shutting down... Why is this happening? You can't change the code againㅠ<

06-14 15:23:31.377 13536-13536/com.ossw.taxiapp E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.ossw.taxiapp, PID: 13536
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ossw.taxiapp/com.ossw.taxiapp.DriverMapActivity}: java.lang.ClassCastException: android.widget.Button cannot be cast to android.view.ViewGroup
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
        at android.app.ActivityThread.access$800(ActivityThread.java:144)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5221)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
     Caused by: java.lang.ClassCastException: android.widget.Button cannot be cast to android.view.ViewGroup
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:807)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
        at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
        at android.app.Activity.setContentView(Activity.java:2144)
        at com.ossw.taxiapp.DriverMapActivity.onCreate(DriverMapActivity.java:59)
        at android.app.Activity.performCreate(Activity.java:5937)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) 
        at android.app.ActivityThread.access$800(ActivityThread.java:144) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5221) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694) 
06-14 15:23:31.400 13536-13567/com.ossw.taxiapp V/FA: Connection attempt already in progress

android error java xml android-studio

2022-09-20 21:59

1 Answers

Error when attempting to refer Button to ViewGroup.


2022-09-20 21:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.