I am using xamarin with enterprise home screen and trying to enable/disable kiosk mode programmatically. Regardless, of wheth...

d daron rice 2 years 11 months ago
16 0 0

My activity looks like this:

 
 
   
     
       
     
   
             
 

my C# looks like this:

  protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            TextView statusBox = FindViewById(Resource.Id.kiosModeStatus);
            // Get our button from the layout resource,
            // and attach an event to it
            Button enableButton = FindViewById(Resource.Id.EnableButton);

            enableButton.Click += delegate
            {
                Intent intent = new Intent("com.symbol.enterprisehomescreen.actions.MODIFY_KIOSK_MODE");
                Intent.PutExtra("enable", true);
                SendBroadcast(intent);
                statusBox.Text = "Enabling....Enable";
            };

            Button disableButton = FindViewById(Resource.Id.DisableButton);

            disableButton.Click += delegate
            {
                Intent intent = new Intent("com.symbol.enterprisehomescreen.actions.MODIFY_KIOSK_MODE");
                Intent.PutExtra("enable", false);
                SendBroadcast(intent);
                statusBox.Text = "Disabling....Disabled";
            };
        }

the button fires, but kiosk mode is still set to whatever value it was set to before the app started.

CONTACT
Can’t find what you’re looking for?