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

ClassCastException in sample #170

Open
MichaelEvans opened this issue Aug 2, 2015 · 1 comment
Open

ClassCastException in sample #170

MichaelEvans opened this issue Aug 2, 2015 · 1 comment

Comments

@MichaelEvans
Copy link

I'm new to mortar, so perhaps this is an easy fix (in which case I'd be glad to send a PR)

Navigating to the a Friend screen and hitting back/up/"friend" in the Actionbar yields a ClassCastException with the stack trace attached. I'm guessing that the answer lies in the fact that FramePathContainerView expects all it's children to be ViewGroups, rather than just views?

 java.lang.ClassCastException: com.example.mortar.view.FriendView cannot be cast to android.view.ViewGroup
            at com.example.mortar.screen.FramePathContainerView.getCurrentChild(FramePathContainerView.java:78)
            at flow.path.PathContainer.executeTraversal(PathContainer.java:71)
            at com.example.mortar.screen.FramePathContainerView.dispatch(FramePathContainerView.java:65)
            at com.example.mortar.core.MortarDemoActivity.dispatch(MortarDemoActivity.java:78)
            at flow.Flow$PendingTraversal.dispatch(Flow.java:315)
            at flow.Flow$2.doExecute(Flow.java:197)
            at flow.Flow$PendingTraversal.execute(Flow.java:323)
            at flow.Flow.move(Flow.java:232)
            at flow.Flow.set(Flow.java:162)
            at com.example.mortar.core.MortarDemoActivity$1.call(MortarDemoActivity.java:72)
            at com.example.mortar.core.MortarDemoActivity$2.onMenuItemClick(MortarDemoActivity.java:166)
            at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:147)
            at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
            at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:546)
            at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:115)
            at android.view.View.performClick(View.java:4438)
            at android.view.View$PerformClick.run(View.java:18422)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            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:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)
@ghost
Copy link

ghost commented Aug 15, 2015

I can confirm the issue.
Correction to recreate steps: "Friends" -> Alex or Chris -> Back/up

daviditkin pushed a commit to daviditkin/mortar that referenced this issue Aug 30, 2016
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

1 participant