10

Issue,

'onActivityResult(Int, Int, Intent?): Unit' is deprecated. Deprecated in Java

As per in-app update docs, the given method requires onActivityResult but that is deprecated.

I can't find any details on how to use registerForActivityResult for the in-app updates.

P.S: I am using Jetpack compose. Relevant answers would be helpful.

Note:
I am well aware that this is not an error but a warning. I am using Jetpack compose and hence this is an issue for me as having activity results makes the code outside Compose.

Abhimanyu
  • 11,351
  • 7
  • 51
  • 121
  • See how I've done it for Facebook in [this answer](https://stackoverflow.com/questions/69107068/facebook-login-with-jetpack-compose), should work for any library which haven't provided new API so far. – Phil Dukhov Oct 28 '21 at 17:03
  • The answer is passing the data using a callback back to compose. It still uses the deprecated method `onActivityResult`. I am trying to avoid it completely. – Abhimanyu Oct 28 '21 at 17:16
  • @Abhimanyu did you found a solution for it yet? – Akshay Ashok Dec 03 '21 at 04:10
  • @AkshayAshok, no – Abhimanyu Dec 03 '21 at 05:56
  • As always documentation from google is outdated. The old method should still work. You have your single Activity for creating compose app and you can use that for creating code for updating. – ShadeToD Dec 06 '21 at 15:26
  • We can't treat this very lightly, even though this is a warning, it overrides ActivityResultContracts being used throughout the app. – devanshu_kaushik Aug 07 '22 at 08:04

0 Answers0