Custom Settings acces in Kiosk mode not working using API

Custom Settings acces in Kiosk mode not working using API

Hello,
according to this article I've added the new intent on back button pressed action for android app. But nothing happend when I'm on single application Kiosk mode when I press back button.
My application is .net MAUI application and for android platform I have used follwoing code:

  1. static bool OnBackPressed(IServiceProvider serviceProvider, Activity activity)
  2. {
  3.     var intent = new Intent();
  4.     intent.SetComponent(new ComponentName("com.manageengine.mdm.android", "com.manageengine.mdm.framework.customsettings.WifiPickerActivity"));
  5.     intent.SetFlags(ActivityFlags.ResetTaskIfNeeded);
  6.     try
  7.     {
  8.         activity.ApplicationContext.StartActivity(intent);
  9.         return true;
  10.     }
  11.     catch (Exception exc)
  12.     {
  13.         var logger = serviceProvider.GetRequiredService<ILogger<IViewModel>>();
  14.         logger.LogError(exc, "Failed to send intent to activate Custom Settings"); 
  15.     }

  16.     return false;
  17. }
OnBackPressed event is registered using following code:
  1.  builder.ConfigureLifecycleEvents((sp, events) =>
  2.  {               
  3.      events.AddAndroid(sp, (serviceProvider,android) =>
  4.      {
  5.          android
  6.              .OnBackPressed(activity => OnBackPressed(serviceProvider, activity))
  7.              .OnCreate((activity, bundle) => OnCreate(serviceProvider, activity.ApplicationContext))
  8.              .OnDestroy(activity => OnDestroy(activity.ApplicationContext));
  9.      });
  10.  });

Is it necessary to do something else? Or is there something wrong in my code?

Thank you for your answers.

                  New to ADSelfService Plus?