java.lang.ClassCastException: com.example.brian.chatapp.MainActivity cannot be cast to android.support.v7.app.ActionBarActivity

Stack Overflow | Brian | 7 months ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    How to declare ArrayList? (Identifier Expected)

    Stack Overflow | 7 months ago | Brian
    java.lang.ClassCastException: com.example.brian.chatapp.MainActivity cannot be cast to android.support.v7.app.ActionBarActivity
  2. 0

    Issue with android.support.v7.app.ActionBarActivity

    Stack Overflow | 7 months ago | Brian
    java.lang.ClassCastException: com.example.brian.chatapp.MainActivity cannot be cast to android.support.v7.app.ActionBarActivity

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.example.brian.chatapp.MainActivity cannot be cast to android.support.v7.app.ActionBarActivity

      at com.example.brian.fragments.Chats.onCreateView()
    2. com.example.brian
      Chats.onCreateView
      1. com.example.brian.fragments.Chats.onCreateView(Chats.java:35)
      1 frame
    3. Android Support v4
      ViewPager.onMeasure
      1. android.support.v4.app.Fragment.performCreateView(Fragment.java:2074)
      2. android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
      3. android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286)
      4. android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758)
      5. android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:1632)
      6. android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:637)
      7. android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:143)
      8. android.support.v4.view.ViewPager.populate(ViewPager.java:1235)
      9. android.support.v4.view.ViewPager.populate(ViewPager.java:1083)
      10. android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1609)
      10 frames
    4. Android Platform
      ViewGroup.measureChildWithMargins
      1. android.view.View.measure(View.java:17430)
      2. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
      2 frames
    5. android.support.design
      CoordinatorLayout.onMeasure
      1. android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:669)
      2. android.support.design.widget.HeaderScrollingViewBehavior.onMeasureChild(HeaderScrollingViewBehavior.java:89)
      3. android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onMeasureChild(AppBarLayout.java:1319)
      4. android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:734)
      4 frames
    6. Android Platform
      FrameLayout.onMeasure
      1. android.view.View.measure(View.java:17430)
      2. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
      3. android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
      3 frames
    7. Android v7
      ContentFrameLayout.onMeasure
      1. android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)
      1 frame
    8. Android Platform
      FrameLayout.onMeasure
      1. android.view.View.measure(View.java:17430)
      2. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
      3. android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
      4. android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
      5. android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
      6. android.view.View.measure(View.java:17430)
      7. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
      8. android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
      9. android.view.View.measure(View.java:17430)
      10. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
      11. android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
      12. android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
      13. android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
      14. android.view.View.measure(View.java:17430)
      15. android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5463)
      16. android.widget.FrameLayout.onMeasure(FrameLayout.java:430)
      16 frames
    9. Android
      PhoneWindow$DecorView.onMeasure
      1. com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2560)
      1 frame
    10. Android Platform
      ActivityThread.main
      1. android.view.View.measure(View.java:17430)
      2. android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2001)
      3. android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1166)
      4. android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1372)
      5. android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1054)
      6. android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5779)
      7. android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
      8. android.view.Choreographer.doCallbacks(Choreographer.java:580)
      9. android.view.Choreographer.doFrame(Choreographer.java:550)
      10. android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
      11. android.os.Handler.handleCallback(Handler.java:739)
      12. android.os.Handler.dispatchMessage(Handler.java:95)
      13. android.os.Looper.loop(Looper.java:135)
      14. android.app.ActivityThread.main(ActivityThread.java:5221)
      14 frames
    11. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invoke(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:372)
      2 frames