java.lang.IllegalStateException: Couldn't get the activity from the view context


Solutions on the web2

Solution icon of github
via GitHub by ima747
, 2 months ago
Couldn't get the activity from the view context

Solution icon of github
via GitHub by cavega
, 9 months ago
Couldn't get the activity from the view context

Stack trace

java.lang.IllegalStateException: Couldn't get the activity from the view context
	at tools.fastlane.screengrab.DecorViewScreenshotStrategy$ScreenshotViewAction.perform(Unknown Source)
	at android.support.test.espresso.ViewInteraction$1.run(Unknown Source)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
	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:6077)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.