{"action":"created","issue":{"url":"https://api.github.com/repos/BenGoBlue05/UdacityAlumni/issues/59","repository_url":"https://api.github.com/repos/BenGoBlue05/UdacityAlumni","labels_url":"https://api.github.com/repos/BenGoBlue05/UdacityAlumni/issues/59/labels{/name}","comments_url":"https://api.github.com/repos/BenGoBlue05/UdacityAlumni/issues/59/comments","events_url":"https://api.github.com/repos/BenGoBlue05/UdacityAlumni/issues/59/events","html_url":"https://github.com/BenGoBlue05/UdacityAlumni/issues/59","id":297676417,"number":59,"title":"SignIn Button not working","user":{"login":"knightcube","id":22871961,"avatar_url":"https://avatars3.githubusercontent.com/u/22871961?v=4","gravatar_id":"","url":"https://api.github.com/users/knightcube","html_url":"https://github.com/knightcube","followers_url":"https://api.github.com/users/knightcube/followers","following_url":"https://api.github.com/users/knightcube/following{/other_user}","gists_url":"https://api.github.com/users/knightcube/gists{/gist_id}","starred_url":"https://api.github.com/users/knightcube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knightcube/subscriptions","organizations_url":"https://api.github.com/users/knightcube/orgs","repos_url":"https://api.github.com/users/knightcube/repos","events_url":"https://api.github.com/users/knightcube/events{/privacy}","received_events_url":"https://api.github.com/users/knightcube/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-16T04:05:32Z","updated_at":"2018-02-27T14:49:21Z","closed_at":"2018-02-27T14:49:21Z","author_association":"NONE","body":"### Steps to reproduce\r\n1)In the LoginActivity.java when i make the following changes-\r\n    a) Remove this line - findViewById(R.id.sign_in_button).setOnClickListener(this);\r\n    b)And use @OnClick annotation on sign_in_button because we are using butterknife library why doesn't the button respond to the click?\r\n\r\n### Expected behavior\r\nButton click should be noticed\r\n\r\n### Actual behavior\r\nButton does not respond. There is no crash as such. It is just a doubt\r\n\r\n### Code Sample\r\nI changed the LoginActivity.java file to this -\r\n\r\n```\r\npackage com.google.developer.udacityalumni.activity;\r\n\r\nimport android.content.Intent;\r\nimport android.os.Bundle;\r\nimport android.support.annotation.NonNull;\r\nimport android.support.v4.content.ContextCompat;\r\nimport android.util.Log;\r\nimport android.view.View;\r\nimport android.widget.Toast;\r\n\r\nimport com.google.android.gms.auth.api.Auth;\r\nimport com.google.android.gms.auth.api.signin.GoogleSignInAccount;\r\nimport com.google.android.gms.auth.api.signin.GoogleSignInOptions;\r\nimport com.google.android.gms.auth.api.signin.GoogleSignInResult;\r\nimport com.google.android.gms.common.ConnectionResult;\r\nimport com.google.android.gms.common.api.GoogleApiClient;\r\nimport com.google.android.gms.tasks.OnCompleteListener;\r\nimport com.google.android.gms.tasks.Task;\r\nimport com.google.developer.udacityalumni.R;\r\nimport com.google.developer.udacityalumni.model.User;\r\nimport com.google.firebase.auth.AuthCredential;\r\nimport com.google.firebase.auth.AuthResult;\r\nimport com.google.firebase.auth.FirebaseAuth;\r\nimport com.google.firebase.auth.FirebaseUser;\r\nimport com.google.firebase.auth.GoogleAuthProvider;\r\nimport com.google.firebase.database.DatabaseReference;\r\nimport com.google.firebase.database.FirebaseDatabase;\r\n\r\nimport butterknife.OnClick;\r\n\r\n/**\r\n * A login screen that offers login via email/password.\r\n */\r\npublic class LoginActivity extends BaseActivity implements GoogleApiClient.OnConnectionFailedListener {\r\n\r\n    private static final String LOG_TAG = LoginActivity.class.getSimpleName();\r\n\r\n    private static final int RC_SIGN_IN = 9001;\r\n    private GoogleApiClient mGoogleApiClient;\r\n    private FirebaseAuth mAuth;\r\n    private DatabaseReference mDatabase;\r\n    private FirebaseAuth.AuthStateListener mAuthListener;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_login);\r\n        getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.colorPrimaryDark));\r\n        mAuth = FirebaseAuth.getInstance();\r\n        mDatabase = FirebaseDatabase.getInstance().getReference();\r\n        GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\r\n                .requestIdToken(getString(R.string.default_web_client_id))\r\n                .requestEmail()\r\n                .build();\r\n\r\n        mGoogleApiClient = new GoogleApiClient.Builder(this)\r\n                .enableAutoManage(this, this /* OnConnectionFailedListener */)\r\n                .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\r\n                .build();\r\n\r\n        mAuthListener = new FirebaseAuth.AuthStateListener() {\r\n            @Override\r\n            public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {\r\n                FirebaseUser user = firebaseAuth.getCurrentUser();\r\n                if (user != null) bindUserValues(user);\r\n            }\r\n        };\r\n    }\r\n\r\n    private void bindUserValues(@NonNull FirebaseUser user) {\r\n        DatabaseReference ref = mDatabase.child(\"users\").child(user.getUid());\r\n        String displayName = user.getDisplayName();\r\n        String email = user.getEmail();\r\n        String photoUrl = user.getPhotoUrl() != null ? user.getPhotoUrl().toString() : null;\r\n        User usr = new User(displayName, email, photoUrl);\r\n        ref.setValue(usr);\r\n    }\r\n\r\n    @OnClick(R.id.sign_in_button)\r\n    public void signInButtonClicked(){\r\n        Log.i(\"TAG\", \"signInButtonClicked: \");\r\n        signIn();\r\n    }\r\n\r\n    private void signIn() {\r\n        Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);\r\n        startActivityForResult(signInIntent, RC_SIGN_IN);\r\n    }\r\n\r\n    @Override\r\n    public void onActivityResult(int requestCode, int resultCode, Intent data) {\r\n        super.onActivityResult(requestCode, resultCode, data);\r\n\r\n        if (requestCode == RC_SIGN_IN) {\r\n            GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);\r\n            if (result.isSuccess()) {\r\n                GoogleSignInAccount account = result.getSignInAccount();\r\n                firebaseAuthWithGoogle(account);\r\n            } else {\r\n                Log.e(LOG_TAG, \"Google Sign In failed.\");\r\n            }\r\n        }\r\n    }\r\n\r\n\r\n    private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {\r\n        Log.d(LOG_TAG, \"firebaseAuthWithGoogle:\" + acct.getId());\r\n        showProgressDialog();\r\n        AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);\r\n        mAuth.signInWithCredential(credential)\r\n                .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\r\n                    @Override\r\n                    public void onComplete(@NonNull Task<AuthResult> task) {\r\n                        Log.i(LOG_TAG, \"signIn:onComplete:\" + task.isSuccessful());\r\n                        hideProgressDialog();\r\n                        if (!task.isSuccessful()) {\r\n                            Log.i(LOG_TAG, \"signInWithCredential\", task.getException());\r\n                            Toast.makeText(LoginActivity.this, \"Authentication failed.\",\r\n                                    Toast.LENGTH_SHORT).show();\r\n                        }\r\n                        startActivity(new Intent(LoginActivity.this, MainActivity.class));\r\n                    }\r\n                });\r\n    }\r\n\r\n\r\n    @Override\r\n    public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\r\n        // An unresolvable error has occurred and Google APIs (including Sign-In) will not\r\n        // be available.\r\n        Log.d(LOG_TAG, \"onConnectionFailed:\" + connectionResult);\r\n        Toast.makeText(this, \"Google Play Services error.\", Toast.LENGTH_SHORT).show();\r\n    }\r\n\r\n    @Override\r\n    public void onStart() {\r\n        super.onStart();\r\n        mAuth.addAuthStateListener(mAuthListener);\r\n    }\r\n\r\n    @Override\r\n    public void onStop() {\r\n        super.onStop();\r\n        if (mAuthListener != null) {\r\n            mAuth.removeAuthStateListener(mAuthListener);\r\n        }\r\n    }\r\n}\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/BenGoBlue05/UdacityAlumni/issues/comments/368902563","html_url":"https://github.com/BenGoBlue05/UdacityAlumni/issues/59#issuecomment-368902563","issue_url":"https://api.github.com/repos/BenGoBlue05/UdacityAlumni/issues/59","id":368902563,"user":{"login":"knightcube","id":22871961,"avatar_url":"https://avatars3.githubusercontent.com/u/22871961?v=4","gravatar_id":"","url":"https://api.github.com/users/knightcube","html_url":"https://github.com/knightcube","followers_url":"https://api.github.com/users/knightcube/followers","following_url":"https://api.github.com/users/knightcube/following{/other_user}","gists_url":"https://api.github.com/users/knightcube/gists{/gist_id}","starred_url":"https://api.github.com/users/knightcube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knightcube/subscriptions","organizations_url":"https://api.github.com/users/knightcube/orgs","repos_url":"https://api.github.com/users/knightcube/repos","events_url":"https://api.github.com/users/knightcube/events{/privacy}","received_events_url":"https://api.github.com/users/knightcube/received_events","type":"User","site_admin":false},"created_at":"2018-02-27T14:49:20Z","updated_at":"2018-02-27T14:49:20Z","author_association":"NONE","body":"by the way my issue is actually resolved....i just did a silly error...i didnt bind the views....silly of me!...i will close this issue right away."}}
{"actor":{"display_login":"knightcube"}}