Hello,
I tried to use following code, I can get the same issue.
#if ANDROID
var res1 = Microsoft.Maui.MauiApplication.Context;
var context = Platform.AppContext;
var reS2= Android.App.Application.Context;
#endif
Q&A is not a bug reporting or tracking system. Please report it in the Maui github repository at https://github.com/dotnet/maui . We will clear details to be able to reproduce and troubleshoot the problem. When you post it, please include version numbers, exact repro steps, and the difference between the expected behaviour and actual behaviour.
By the way, if you want to get current Activity, you can use var CurrentActivity= Microsoft.Maui.ApplicationModel.Platform.CurrentActivity;
, it is working as normal in .NET 8
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.