is it possible to start intent of Android?

Yuan Jeffers 1 Reputation point
2022-08-12T07:57:48.947+00:00

Hi,

I am newbie.
I would like to know is it possible to start an intent via click a button at maui?
Such like
startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS))
or
startActivity(new Intent(Settings.ACTION_SETTINGS));

Thanks.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,231 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Antonio Lopes 1 Reputation point
    2024-05-30T10:48:17.8533333+00:00

    Of course

    private void OpenBluetoothSetting()
    {
    #if ANDROID
        //Android.Content.Intent    //Android.Provider.Settings.ActionWifiSettings
        var intent = new Intent(Android.Provider.Settings.ActionBluetoothSettings);
        //Microsoft.Maui.ApplicationModel.Platform
        var activity = Platform.CurrentActivity;
        activity?.StartActivity(intent);
    #endif
    }
    
    0 comments No comments