Skip to content

Commit b332f20

Browse files
committed
Update to remove casting
1 parent 08000b8 commit b332f20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/touchinput/keyboardinput/KeyboardShortcutsHelper.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import android.view.KeyboardShortcutGroup
2424
import android.view.KeyboardShortcutInfo
2525
import android.view.Menu
2626
import androidx.activity.ComponentActivity
27+
import androidx.activity.compose.LocalActivity
2728
import androidx.activity.compose.setContent
2829
import androidx.activity.enableEdgeToEdge
2930
import androidx.annotation.RequiresApi
@@ -66,7 +67,7 @@ class AnotherActivity : ComponentActivity() {
6667
setContent {
6768
MaterialTheme {
6869
// [START android_compose_keyboard_shortcuts_helper_request]
69-
val activity = LocalContext.current as? Activity
70+
val activity = LocalActivity.current
7071

7172
Button(
7273
onClick = {

0 commit comments

Comments
 (0)