Skip to content

Taking a screenshot within a fragment causes a crash #8

Open
@TrentPierce

Description

Do you want to request a feature or report a bug?
Report A Bug

What is the current behavior?
My app is crashing upon trying to take a screenshot in a fragment

If the current behavior is a bug, please provide the steps to reproduce.

Any logs, error output, bugreport etc?

07-30 22:32:47.013 2675-2675/com.octothorpeplus.evanstonsubaru E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.octothorpeplus.evanstonsubaru, PID: 2675
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.measure(int, int)' on a null object reference
at github.nisrulz.screenshott.ScreenShott.takeScreenShotOfJustView(ScreenShott.java:98)
at com.octothropeplus.octolib.fragments.RewardFragment.saveScreenshot(RewardFragment.java:71)
at com.octothropeplus.octolib.fragments.RewardFragment.onCreateView(RewardFragment.java:63)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2087)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1113)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1295)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:801)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1682)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:541)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6682)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

What is the expected behavior?
I expect it to take and save the screenshot
Any other comments?

What versions of software are you using?

  • Device Information:
    Samsung Note 5

  • Android Version:
    7.1.1

  • Configuration Information:

  • Misc:

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions