public override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if (savedInstanceState != null)
            {
                mRetryCounter              = savedInstanceState.GetInt(KEY_RETRY_COUNTER);
                mRetryLoadFullWalletCount  = savedInstanceState.GetInt(KEY_RETRY_FULL_WALLET_COUNTER);
                mHandleFullWalletWhenReady =
                    savedInstanceState.GetBoolean(KEY_HANDLE_FULL_WALLET_WHEN_READY);
            }
            mActivityLaunchIntent = Activity.Intent;
            mItemId       = mActivityLaunchIntent.GetIntExtra(Constants.EXTRA_ITEM_ID, 0);
            mMaskedWallet = mActivityLaunchIntent.GetParcelableExtra(Constants.EXTRA_MASKED_WALLET).JavaCast <MaskedWallet> ();

            var accountName = ((BikestoreApplication)Activity.Application).AccountName;

            // Set up an API client;
            mGoogleApiClient = new GoogleApiClient.Builder(Activity)
                               .AddConnectionCallbacks(this)
                               .AddOnConnectionFailedListener(this)
                               .SetAccountName(accountName)
                               .AddApi(WalletClass.API, new WalletClass.WalletOptions.Builder()
                                       .SetEnvironment(Constants.WALLET_ENVIRONMENT)
                                       .SetTheme(WalletConstants.ThemeLight)
                                       .Build())
                               .Build();

            mRetryHandler = new RetryHandler(this);
        }
コード例 #2
0
        public override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if (savedInstanceState != null)
            {
                mSignInButtonClicked = savedInstanceState.GetBoolean(KEY_SIGNIN_BUTTON_CLICKED);
            }

            var args = Arguments;

            if (args != null)
            {
                mLoginAction = args.GetInt(LoginActivity.EXTRA_ACTION);
            }

            var options = new PlusClass.PlusOptions.Builder().Build();

            mGoogleApiClient = new GoogleApiClient.Builder(Activity)
                               .AddApi(PlusClass.API, options)
                               .AddConnectionCallbacks(this)
                               .AddOnConnectionFailedListener(this)
                               .AddScope(PlusClass.ScopePlusProfile)
                               .AddScope(new Scope(WALLET_SCOPE))
                               .Build();
        }
コード例 #3
0
 public override void OnCreate(Android.OS.Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     Android.Util.Log.Info("SuperAwesomeCardFragment", string.Format("OnCreate called"));
     if (savedInstanceState != null)
     {
         _position             = savedInstanceState.GetInt("position", 0);
         _enableProgressButton = savedInstanceState.GetBoolean("enableProgressButton", false);
     }
     if (this.View != null)
     {
         Android.Util.Log.Info("SuperAwesomeCardFragment", string.Format(string.Format("View already present for position {0}", _position)));
     }
 }
        public override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            if (savedInstanceState != null)
            {
                mPromoWasSelected = savedInstanceState.GetBoolean(KEY_PROMO_CLICKED);
            }

            var accountName = ((BikestoreApplication)Activity.Application).AccountName;
            var options     = new Android.Gms.Identity.Intents.Address.AddressOptions(Android.Gms.Wallet.WalletConstants.ThemeLight);

            mGoogleApiClient = new Android.Gms.Common.Apis.GoogleApiClient.Builder(Activity)
                               .AddApi(Android.Gms.Identity.Intents.Address.Api, options)
                               .SetAccountName(accountName)
                               .AddConnectionCallbacks(this)
                               .AddOnConnectionFailedListener(this)
                               .Build();
        }
コード例 #5
0
            //MyOrientationListener Listener { get; set; }

            protected override void OnCreate(Android.OS.Bundle savedInstanceState)
            {
                base.OnCreate(savedInstanceState);

                //Listener = new MyOrientationListener( this, Android.Hardware.SensorDelay.Normal );
                //Listener.Enable( );

                bool didStartCamera = false;

                if (savedInstanceState != null)
                {
                    // grab the last active element
                    didStartCamera = savedInstanceState.GetBoolean("DidStartCamera");
                    ImageFile      = savedInstanceState.GetString("ImageFile");
                }

                // make sure the camera hasn't already been started, which will happen if
                // the orientation of the device is changed while looking at the camera's preview
                // image.
                if (didStartCamera == false)
                {
                    // retrieve the desired location
                    Java.IO.File imageFile = (Java.IO.File) this.Intent.Extras.Get("ImageDest");

                    // create our intent and launch the camera
                    Intent intent = new Intent(MediaStore.ActionImageCapture);

                    // notify the intent where the captured image should go.
                    intent.PutExtra(MediaStore.ExtraOutput, Uri.FromFile(imageFile));

                    // store it as an aboslute string
                    ImageFile = imageFile.AbsolutePath;

                    StartActivityForResult(intent, 0);
                }
            }