22

In which case I have

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.app.ActivityOptions.isReturning()' on a null object reference

I cannot understand why EnterActivityOptions.isReturning() in ActivityTransitionState give me null?

Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162
Rayna Ivanova
  • 239
  • 1
  • 4

3 Answers3

4

Try with support library 24.1.0 (released today, but not sure if this fix your problem)

Daniel Gomez Rico
  • 15,026
  • 20
  • 92
  • 162
1

I believe the problem is with the variable EnterActivityOptions When I look into your code sample it's look like you assigned some value to EnterActivityOptions in the method of setEnterActivityOptions

But I am not sure that this method is calling when you invoke the activity.

if it's not calling the method then obviously it will not be initialized and the variable value will be null this results NullPointerException.

So, to resolve this issue please try to check the case whether EnterActivityOptions is null or not and then use the condition

if (mEnterActivityOptions.isReturning()) {
    Your code will place here
}
Bethan
  • 971
  • 8
  • 23
-2

On API 21, only one call to startPostponedEnterTransition is allowed

Jon
  • 9,156
  • 9
  • 56
  • 73