protected override void OnStart()
        {
            _settings = MainSettings.GetCurrent(this);
            UpdateActivityState();
            Logger.Verbose("Starting MainActivity");
            base.OnStart();

        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            _settings = MainSettings.GetCurrent(this);

            Logger.Init(LogMessage);
            Logger.Verbose("Creating MainActivity");
            
            _button = FindViewById<Button>(Resource.Id.button);
            _button.Click += OnButtonClick;
        }
 public static MainSettings GetCurrent(Context context)
 {
     var sharedPrefs = PreferenceManager.GetDefaultSharedPreferences(context);
     var settings = new MainSettings
     {
         AuthSettings = new AuthSettings(sharedPrefs),
         ConnectionSettings = new ConnectionSettings(sharedPrefs),
         LoginPageSettings = new LoginPageSettings(sharedPrefs),
         OtherSettings = new OtherSettings(sharedPrefs)
     };
     return settings;
 }
 private void OpenWebBrowserIfRequired(MainSettings settings)
 {
     if (!string.IsNullOrWhiteSpace(settings.OtherSettings.StartUrl))
     {
         var uri = Android.Net.Uri.Parse(settings.OtherSettings.StartUrl);
         var intent = new Intent(Intent.ActionView, uri);
         StartActivity(intent);
     }
 }