diff --git a/build-profile.json5 b/build-profile.json5 index c033ce4278fb0641d84107c3c134047ac487368e..e8de1a3cb6ba71c60762653ebac9cfdc1cfa0132 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -5,7 +5,7 @@ { "name": "default", "signingConfig": "default", - "compatibleSdkVersion": "5.0.0(12)", + "compatibleSdkVersion": "5.0.4(16)", "runtimeOS": "HarmonyOS", } ], diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 2d32df45e8afc7cbc715ec010487b0c187bd01a0..b3ccd187733702e73a408b6260dffbe18d62bd54 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -55,7 +55,7 @@ struct Index { } invokeCamera(callback: (uri: string) => void) { - const context = getContext(this) as common.UIAbilityContext; + const context = this.getUIContext().getHostContext() as common.UIAbilityContext; const want: Want = { action: ACTION_IMAGE_CAPTURE, parameters: {