Modifying the name of the Android Studio project

0

I modified the name of the project using Refactor - Rename, more time to copy from this error:

Logcat:

04-18 06:40:04.480 19491-19491/? D/dalvikvm: Late-enabling CheckJNI
04-18 06:40:04.680 19491-19491/com.example.jeferson.Vote25 D/AndroidRuntime: Shutting down VM
04-18 06:40:04.680 19491-19491/com.example.jeferson.Vote25 W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x64cbcb20)
04-18 06:40:04.680 19491-19491/com.example.jeferson.Vote25 D/AndroidRuntime: procName from cmdline: com.example.jeferson.Vote25
04-18 06:40:04.680 19491-19491/com.example.jeferson.Vote25 E/AndroidRuntime: in writeCrashedAppName, pkgName :com.example.jeferson.Vote25
04-18 06:40:04.690 19491-19491/com.example.jeferson.Vote25 D/AndroidRuntime: file written successfully with content: com.example.jeferson.Vote25 StringBuffer : ;com.example.jeferson.Vote25
04-18 06:40:04.800 19491-19491/? I/Process: Sending signal. PID: 19491 SIG: 9
04-18 06:40:04.800 19491-19491/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.jeferson.Vote25, PID: 19491
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.jeferson.Vote25/com.example.jeferson.Vote25.MainActivity}: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button
at com.example.jeferson.Vote25.MainActivity.onCreate(MainActivity.java:28)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5021) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:515) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:827) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643) 
at dalvik.system.NativeStart.main(Native Method) 
    
asked by anonymous 18.04.2016 / 11:34

1 answer

0

The problem lies in this line:

Caused by: java.lang.ClassCastException: android.widget.ImageButton cannot be cast to android.widget.Button

A component has been declared in the xml (view) and retrieved otherwise in Activity.

    
18.04.2016 / 13:14