Skip to main content
Question

Andriod app crash on configuration changes

  • January 22, 2024
  • 1 reply
  • 32 views

Forum|alt.badge.img+6

Hello,

I have a single activity Andriod  app trying to implement Revenue Cat.

I experience app crashes when an configuration change, i.e. screen rotation, occur during the call to  

Purchases.sharedInstance.restorePurchasesWith…. The method is called from a Fragment and work as intended unless an configuration change occur before Purchases.sharedInstance.restorePurchasesWith… returns the call.

Do anyone have any suggestions how to handle configuration changes, should I move calls to the Revenenue Cat SDK to a viewmodel?

 

Best Regards, Tomas

This post has been closed for comments

1 reply

Forum|alt.badge.img+6
  • Author
  • Member
  • January 29, 2024

Hi,

I replay on my own question. This has nothing to do with the Revenue cat SDK. I realized I got the context in a stupid way, requirecontext() that throws instead of getContext that can be null checked.

 

Best Regards Tomas