com.virtual.tour.road.com.virtual.tour.road.vista

## Class LoginActivity

- java.lang.Object
- - android.content.Context
  - - android.content.ContextWrapper
    - - android.view.ContextThemeWrapper
      - - android.app.Activity
        - - com.virtual.tour.road.com.virtual.tour.road.vista.LoginActivity

- All Implemented Interfaces:
    android.content.ComponentCallbacks, android.content.ComponentCallbacks2, android.view.KeyEvent.Callback, android.view.LayoutInflater.Factory, android.view.LayoutInflater.Factory2, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.Window.Callback, android.view.Window.OnWindowDismissedCallback, com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks, com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener

      public class LoginActivity
      extends android.app.Activity
      implements android.view.View.OnClickListener, com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks, com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener

  Created by Carolina Bonnin. Actividad para gestionar el Login y Logout con Google +

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class android.app.Activity

      `android.app.Activity.TranslucentConversionListener`

    - ### Nested classes/interfaces inherited from class android.content.Context

      `android.content.Context.BindServiceFlags, android.content.Context.CreatePackageOptions, android.content.Context.ServiceName`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private com.google.android.gms.common.SignInButton` | `btnSignIn`
    `private android.widget.Button` | `btnSignOut`
    `private Controlador` | `controlador`
    `private android.widget.LinearLayout` | `llProfileLayout`
    `private java.lang.String` | `mail`
    `private com.google.android.gms.common.ConnectionResult` | `mConnectionResult`
    `private com.google.android.gms.common.api.GoogleApiClient` | `mGoogleApiClient`
    `private boolean` | `mIntentInProgress`
    `private boolean` | `mSignInClicked`
    `private static int` | `RC_SIGN_IN`
    `private static java.lang.String` | `TAG`

    - ### Fields inherited from class android.app.Activity

      `DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK`

    - ### Fields inherited from class android.content.Context

      `ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BACKUP_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_IMPORTANT, BIND_NOT_FOREGROUND, BIND_NOT_VISIBLE, BIND_SHOWING_UI, BIND_TREAT_LIKE_ACTIVITY, BIND_VISIBLE, BIND_WAIVE_PRIORITY, BLUETOOTH_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CLIPBOARD_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_REGISTER_PACKAGE, CONTEXT_RESTRICTED, COUNTRY_DETECTOR, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, ETHERNET_SERVICE, FINGERPRINT_SERVICE, HDMI_CONTROL_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_PRIVATE, NETWORK_POLICY_SERVICE, NETWORK_SCORE_SERVICE, NETWORK_STATS_SERVICE, NETWORKMANAGEMENT_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, PERSISTENT_DATA_BLOCK_SERVICE, POWER_SERVICE, PRINT_SERVICE, RESTRICTIONS_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, SERIAL_SERVICE, SIP_SERVICE, STATUS_BAR_SERVICE, STORAGE_SERVICE, TELECOM_SERVICE, TELEPHONY_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TRUST_SERVICE, TV_INPUT_SERVICE, UI_MODE_SERVICE, UPDATE_LOCK_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, VOICE_INTERACTION_MANAGER_SERVICE, WALLPAPER_SERVICE, WIFI_P2P_SERVICE, WIFI_PASSPOINT_SERVICE, WIFI_RTT_SERVICE, WIFI_SCANNING_SERVICE, WIFI_SERVICE, WINDOW_SERVICE`

    - ### Fields inherited from interface com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks

      `CAUSE_NETWORK_LOST, CAUSE_SERVICE_DISCONNECTED`

    - ### Fields inherited from interface android.content.ComponentCallbacks2

      `TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `LoginActivity()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `onActivityResult(int requestCode, int responseCode, android.content.Intent intent)` Called when an activity you launched exits, giving you the requestCode you started it with, the resultCode it returned, and any additional data from it.
    `void` | `onClick(android.view.View v)` Gestion de onClickListeners para los botones de Login y Logout.
    `void` | `onConnected(android.os.Bundle arg0)`
    `void` | `onConnectionFailed(com.google.android.gms.common.ConnectionResult result)` Metodo para gestionar el fallo de conexion.
    `void` | `onConnectionSuspended(int arg0)`
    `protected void` | `onCreate(android.os.Bundle savedInstanceState)` Called when the activity is starting.
    `protected void` | `onStart()` Called after `Activity.onCreate(android.os.Bundle)` — or after `Activity.onRestart()` when the activity had been stopped, but is now again being displayed to the user.
    `protected void` | `onStop()` Called when you are no longer visible to the user.
    `private void` | `resolveSignInError()` Metodo para resolver errores de conexion
    `private void` | `showLogOut()` Metodo para ocultar el boton de inicio de sesion y mostrar el de cierre de sesion.
    `private void` | `signInWithGplus()` Metodo para iniciar sesion
    `private void` | `signOutFromGplus()` Metodo para cerrar sesion
    `private void` | `updateUI(boolean isSignedIn)` Metodo para la actualizacion de la UI y gestion de usuarios.

    - ### Methods inherited from class android.app.Activity

      `addContentView, closeContextMenu, closeOptionsMenu, convertFromTranslucent, convertToTranslucent, createPendingResult, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, dump, findViewById, finish, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getActivityToken, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentFocus, getFragmentManager, getIntent, getLayoutInflater, getLoaderManager, getLocalClassName, getMediaController, getMenuInflater, getParent, getParentActivityIntent, getPreferences, getRequestedOrientation, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, invalidateOptionsMenu, isBackgroundVisibleBehind, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isResumed, isTaskRoot, isVoiceInteraction, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onApplyThemeResource, onAttachedToWindow, onAttachFragment, onBackgroundVisibleBehindChanged, onBackPressed, onChildTitleChanged, onConfigurationChanged, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onCreateThumbnail, onCreateView, onCreateView, onDestroy, onDetachedFromWindow, onEnterAnimationComplete, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onLowMemory, onMenuItemSelected, onMenuOpened, onNavigateUp, onNavigateUpFromChild, onNewActivityOptions, onNewIntent, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPause, onPostCreate, onPostCreate, onPostResume, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onPreparePanel, onProvideAssistData, onRestart, onRestoreInstanceState, onRestoreInstanceState, onResume, onSaveInstanceState, onSaveInstanceState, onSearchRequested, onTitleChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowDismissed, onWindowFocusChanged, onWindowStartingActionMode, openContextMenu, openOptionsMenu, overridePendingTransition, postponeEnterTransition, recreate, registerForContextMenu, releaseInstance, reportFullyDrawn, requestVisibleBehind, requestWindowFeature, runOnUiThread, setActionBar, setContentTransitionManager, setContentView, setContentView, setContentView, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setIntent, setMediaController, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setTaskDescription, setTitle, setTitle, setVisible, setVolumeControlStream, shouldUpRecreateTask, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityAsCaller, startActivityAsUser, startActivityAsUser, startActivityForResult, startActivityForResult, startActivityForResultAsUser, startActivityForResultAsUser, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderForResult, startIntentSenderForResult, startIntentSenderFromChild, startIntentSenderFromChild, startLockTask, startNextMatchingActivity, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLockTask, takeKeyEvents, triggerSearch, unregisterForContextMenu`

    - ### Methods inherited from class android.view.ContextThemeWrapper

      `applyOverrideConfiguration, attachBaseContext, getResources, getTheme, getThemeResId, setTheme`

    - ### Methods inherited from class android.content.ContextWrapper

      `bindService, bindServiceAsUser, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkUriPermission, checkUriPermission, clearWallpaper, createApplicationContext, createConfigurationContext, createDisplayContext, createPackageContext, createPackageContextAsUser, databaseList, deleteDatabase, deleteFile, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getAssets, getBaseContext, getBasePackageName, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDir, getDisplayAdjustments, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getSharedPrefsFile, getUserId, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isRestricted, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, registerReceiverAsUser, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startActivitiesAsUser, startInstrumentation, startService, startServiceAsUser, stopService, stopServiceAsUser, unbindService, unregisterReceiver`

    - ### Methods inherited from class android.content.Context

      `getDrawable, getString, getString, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### btnSignIn

          private com.google.android.gms.common.SignInButton btnSignIn

    - #### btnSignOut

          private android.widget.Button btnSignOut

    - #### controlador

          private Controlador controlador

    - #### llProfileLayout

          private android.widget.LinearLayout llProfileLayout

    - #### mail

          private java.lang.String mail

    - #### mConnectionResult

          private com.google.android.gms.common.ConnectionResult mConnectionResult

    - #### mGoogleApiClient

          private com.google.android.gms.common.api.GoogleApiClient mGoogleApiClient

    - #### mIntentInProgress

          private boolean mIntentInProgress

    - #### mSignInClicked

          private boolean mSignInClicked

    - #### RC_SIGN_IN

          private static final int RC_SIGN_IN

      See Also:
        Constant Field Values

    - #### TAG

          private static final java.lang.String TAG

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### LoginActivity

          public LoginActivity()

  - ### Method Detail

    - #### onActivityResult

          protected void onActivityResult(int requestCode,
                                          int responseCode,
                                          android.content.Intent intent)

      Description copied from class: `android.app.Activity`
      Called when an activity you launched exits, giving you the requestCode you started it with, the resultCode it returned, and any additional data from it. The resultCode will be `Activity.RESULT_CANCELED` if the activity explicitly returned that, didn't return any result, or crashed during its operation.

      You will receive this call immediately before onResume() when your activity is re-starting.

      Overrides:
        `onActivityResult` in class `android.app.Activity`
      Parameters:
        `requestCode` - The integer request code originally supplied to startActivityForResult(), allowing you to identify who this result came from.
        `responseCode` - The integer result code returned by the child activity through its setResult().
        `intent` - An Intent, which can return result data to the caller (various data can be attached to Intent "extras").
      See Also:
        `Activity.startActivityForResult(android.content.Intent, int)`, `Activity.createPendingResult(int, android.content.Intent, int)`, `Activity.setResult(int)`

    - #### onClick

          public void onClick(android.view.View v)

      Gestion de onClickListeners para los botones de Login y Logout.
      Specified by:
        `onClick` in interface `android.view.View.OnClickListener`
      Parameters:
        `v` - The view that was clicked.

    - #### onConnected

          public void onConnected(android.os.Bundle arg0)

      Specified by:
        `onConnected` in interface `com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks`

    - #### onConnectionFailed

          public void onConnectionFailed(com.google.android.gms.common.ConnectionResult result)

      Metodo para gestionar el fallo de conexion.
      Specified by:
        `onConnectionFailed` in interface `com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener`
      Parameters:
        `result` - resultado del fallo de conexion.

    - #### onConnectionSuspended

          public void onConnectionSuspended(int arg0)

      Specified by:
        `onConnectionSuspended` in interface `com.google.android.gms.common.api.GoogleApiClient.ConnectionCallbacks`

    - #### onCreate

          protected void onCreate(android.os.Bundle savedInstanceState)

      Description copied from class: `android.app.Activity`
      Called when the activity is starting. This is where most initialization should go: calling `Activity.setContentView(int)` to inflate the activity's UI, using `Activity.findViewById(int)` to programmatically interact with widgets in the UI, calling `Activity.managedQuery(android.net.Uri , String[], String, String[], String)` to retrieve cursors for data being displayed, etc.

      You can call `Activity.finish(boolean)` from within this function, in which case onDestroy() will be immediately called without any of the rest of the activity lifecycle (`Activity.onStart()`, `Activity.onResume()`, `Activity.onPause()`, etc) executing.

      Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.

      Overrides:
        `onCreate` in class `android.app.Activity`
      Parameters:
        `savedInstanceState` - If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in `Activity.onSaveInstanceState(android.os.Bundle)`. Note: Otherwise it is null.
      See Also:
        `Activity.onStart()`, `Activity.onSaveInstanceState(android.os.Bundle)`, `Activity.onRestoreInstanceState(android.os.Bundle)`, `Activity.onPostCreate(android.os.Bundle)`

    - #### onStart

          protected void onStart()

      Description copied from class: `android.app.Activity`
      Called after `Activity.onCreate(android.os.Bundle)` — or after `Activity.onRestart()` when the activity had been stopped, but is now again being displayed to the user. It will be followed by `Activity.onResume()`.

      Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.

      Overrides:
        `onStart` in class `android.app.Activity`
      See Also:
        `Activity.onCreate(android.os.Bundle)`, `Activity.onStop()`, `Activity.onResume()`

    - #### onStop

          protected void onStop()

      Description copied from class: `android.app.Activity`
      Called when you are no longer visible to the user. You will next receive either `Activity.onRestart()`, `Activity.onDestroy()`, or nothing, depending on later user activity.

      Note that this method may never be called, in low memory situations where the system does not have enough memory to keep your activity's process running after its `Activity.onPause()` method is called.

      Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.

      Overrides:
        `onStop` in class `android.app.Activity`
      See Also:
        `Activity.onRestart()`, `Activity.onResume()`, `Activity.onSaveInstanceState(android.os.Bundle)`, `Activity.onDestroy()`

    - #### resolveSignInError

          private void resolveSignInError()

      Metodo para resolver errores de conexion

    - #### showLogOut

          private void showLogOut()

      Metodo para ocultar el boton de inicio de sesion y mostrar el de cierre de sesion.

    - #### signInWithGplus

          private void signInWithGplus()

      Metodo para iniciar sesion

    - #### signOutFromGplus

          private void signOutFromGplus()

      Metodo para cerrar sesion

    - #### updateUI

          private void updateUI(boolean isSignedIn)

      Metodo para la actualizacion de la UI y gestion de usuarios.