From 3033ee10d480cdd1e87e826eb13812253a8371af Mon Sep 17 00:00:00 2001 From: Andy Cuong Date: Sun, 3 Nov 2024 21:03:17 +0200 Subject: [PATCH] Replace deprecated intent function Replace `ContextCompat.startActivity()` with `context.startActivity()` --- app/src/main/java/com/example/dessertclicker/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/dessertclicker/MainActivity.kt b/app/src/main/java/com/example/dessertclicker/MainActivity.kt index d606256..575ef18 100644 --- a/app/src/main/java/com/example/dessertclicker/MainActivity.kt +++ b/app/src/main/java/com/example/dessertclicker/MainActivity.kt @@ -129,7 +129,7 @@ private fun shareSoldDessertsInformation(intentContext: Context, dessertsSold: I val shareIntent = Intent.createChooser(sendIntent, null) try { - ContextCompat.startActivity(intentContext, shareIntent, null) + intentContext.startActivity(shareIntent) } catch (e: ActivityNotFoundException) { Toast.makeText( intentContext,