Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting an action to the button rectangle crashes the app! #104

Closed
MelodyAustin opened this issue Jan 16, 2015 · 6 comments
Closed

Setting an action to the button rectangle crashes the app! #104

MelodyAustin opened this issue Jan 16, 2015 · 6 comments

Comments

@MelodyAustin
Copy link

I have just directly copied the button from your code and replaced a button on my app with it with the button id. But now the app crashes, please let me know what needs to be done..

@Inoy1st
Copy link

Inoy1st commented Jan 16, 2015

If you want to get any help on error - paste your error message

@MelodyAustin
Copy link
Author

I don't get an error, the app would just crash on the device. The button works when nothing is set for it to do, but when I set an action to it and run it on device, the app would just crash..

@navasmdc
Copy link
Owner

Hi, Can you paste your stacktrace error?

@MelodyAustin
Copy link
Author

Hello these are the errors in my Logcat

java.lang.RuntimeException: Unable to start activity ComponentInfo{infinitetech.chemequator/infinitetech.chemequator.MainActivity}: java.lang.ClassCastException: com.gc.materialdesign.views.ButtonRectangle cannot be cast to android.widget.Button
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2198)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2225)
at android.app.ActivityThread.access$600(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1301)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:153)
at android.app.ActivityThread.main(ActivityThread.java:5096)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: com.gc.materialdesign.views.ButtonRectangle cannot be cast to android.widget.Button
at infinitetech.chemequator.MainActivity.defaultops(MainActivity.java:56)
at infinitetech.chemequator.MainActivity.onCreate(MainActivity.java:44)
at android.app.Activity.performCreate(Activity.java:5244)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1082)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2162)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2225)
            at android.app.ActivityThread.access$600(ActivityThread.java:151)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1301)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:153)
            at android.app.ActivityThread.main(ActivityThread.java:5096)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
            at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
            at dalvik.system.NativeStart.main(Native Method)

@MelodyAustin
Copy link
Author

Sorry I figured it out :P Had to import the view and then set the button to com....Button rectangle instead of the usual Button.
Thank you for taking your time

@Inoy1st
Copy link

Inoy1st commented Jan 17, 2015

I was believing in you :)

P.S.: if there is no error now, you can close issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants