java.lang.IllegalStateException: Fragment BasicFragmentVideo{e87fd0c} not attached to Activity

Stack Overflow | hulapalu | 2 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to Rafael Fischer Viola and rafael . Or join the community to write better ones.
  1. 0

    App crashes due to TextView in Android

    Stack Overflow | 2 months ago | hulapalu
    java.lang.IllegalStateException: Fragment BasicFragmentVideo{e87fd0c} not attached to Activity
  2. 0

    Android - Fragment not attached to Activity if device rotates

    Stack Overflow | 2 months ago | dze_co
    java.lang.IllegalStateException: Fragment BasicFragmentVideo{f4d433} not attached to Activity
  3. 0
    samebug tip
    Check if you imported android.support.v4.app.FragmentManager and not android.app.FragmentManager. Check for naming problems in your xml files as well, might have inconsistencies!
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    Also, check if you're not using android.support.v4.app.FragmentTransaction with android.app.Fragment, as they're not totally compatible.
  6. 0
    samebug tip
    As of SDK 23, you have to call this method with ContextCompat.getColor(context, R.color.my_color) so it works with previous API as well. Also, you have to add the support V4 library to your dependencies: "compile 'com.android.support:support-v4:23.0.1'"
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.IllegalStateException

    Fragment BasicFragmentVideo{e87fd0c} not attached to Activity

    at android.app.Fragment.getResources()
  2. Android Platform
    Fragment.getString
    1. android.app.Fragment.getResources(Fragment.java:805)
    2. android.app.Fragment.getString(Fragment.java:840)
    2 frames
  3. k.com.kamera
    BasicFragmentVideo$5$1$1.run
    1. k.com.kamera.BasicFragmentVideo$5$1$1.run(BasicFragmentVideo.java:483)
    1 frame
  4. Android Platform
    ActivityThread.main
    1. android.os.Handler.handleCallback(Handler.java:739)
    2. android.os.Handler.dispatchMessage(Handler.java:95)
    3. android.os.Looper.loop(Looper.java:168)
    4. android.app.ActivityThread.main(ActivityThread.java:5845)
    4 frames
  5. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    1 frame
  6. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
    2 frames