C2dmSharp.Client.Sample.DefaultActivity.updateView C# (CSharp) Method

updateView() public method

public updateView ( ) : void
return void
        void updateView()
        {
            //Get the stored latest registration id
            var registrationId = C2dmClient.GetRegistrationId(this);

            //If it's empty, we need to register
            if (string.IsNullOrEmpty(registrationId))
            {
                registered = false;
                this.textRegistrationStatus.Text = "Registered: No";
                this.textRegistrationId.Text = "Id: N/A";
                this.buttonRegister.Text = "Register...";

                Log.Info("C2DM-Sharp", "Not registered...");
            }
            else
            {
                registered = true;
                this.textRegistrationStatus.Text = "Registered: Yes";
                this.textRegistrationId.Text = "Id: " + registrationId;
                this.buttonRegister.Text = "Unregister...";

                Log.Info("C2DM-Sharp", "Already Registered: " + registrationId);
            }

            var prefs = GetSharedPreferences("c2dm.client.sample", FileCreationMode.Private);
            this.textLastMsg.Text = "Last Msg: " + prefs.GetString("last_msg", "N/A");

            //Enable the button as it was normally disabled
            this.buttonRegister.Enabled = true;
        }