protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.main_activity); mResultReceiver = new AddressResultReceiver(new Handler()); mResultReceiver.OnReceiveResultImpl = (resultCode, resultData) => { mAddressOutput = resultData.GetString(Constants.ResultDataKey); DisplayAddressOutput(); if (resultCode == 0) { ShowToast(GetString(Resource.String.address_found)); } mAddressRequested = false; UpdateUIWidgets(); }; mLocationAddressTextView = FindViewById <TextView> (Resource.Id.location_address_view); mProgressBar = FindViewById <ProgressBar> (Resource.Id.progress_bar); mFetchAddressButton = FindViewById <Button> (Resource.Id.fetch_address_button); mFetchAddressButton.Click += FetchAddressButtonHandler; mAddressOutput = string.Empty; UpdateValuesFromBundle(savedInstanceState); UpdateUIWidgets(); BuildGoogleApiClient(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.main_activity); mResultReceiver = new AddressResultReceiver(new Handler()) { Activity = this }; mLocationAddressTextView = FindViewById <TextView>(Resource.Id.location_address_view); mProgressBar = FindViewById <ProgressBar>(Resource.Id.progress_bar); mFetchAddressButton = FindViewById <Button>(Resource.Id.fetch_address_button); mFetchAddressButton.Click += FetchAddressButtonHandler; mAddressRequested = false; mAddressOutput = string.Empty; UpdateValuesFromBundle(savedInstanceState); mFusedLocationClient = LocationServices.GetFusedLocationProviderClient(this); UpdateUiWidgets(); }