Code example for PlusClient

Methods: getCurrentPerson, isConnected

0
        dialog.show();
    } 
 
    public void showinfo(View view) {
        AlertDialog dialog = new AlertDialog.Builder(this).create();
        if(mPlusClient.isConnected()) {
            dialog.setMessage(getHangoutParticipants());
        } else { 
           dialog.setMessage("Please Sign in");
        } 
        loadMPlusMessages(); 
        //dialog.show(); 
//        Plus.Activities.List listActivities = plus.activities().list("me", "public"); 
//        listActivities.setMaxResults(5L); 
//        // Pro tip: Use partial responses to improve response time considerably 
//        listActivities.setFields("nextPageToken,items(id,url,object/content)"); 
//        ActivityFeed feed = listActivities.execute(); 
    } 
 
    public void onClick(View view){
 
        if(view.getId() == R.id.sign_in_button && mPlusClient.isConnected()) {
            AlertDialog dialog = new AlertDialog.Builder(this).create();
            dialog.setMessage("Already signed in");
            dialog.show();
        } 
        if (view.getId() == R.id.sign_in_button && !mPlusClient.isConnected()) {
            if (mConnectionResult == null) {
                mConnectionProgressDialog.show();
            } else { 
                try { 
                    mConnectionResult.startResolutionForResult(this, REQUEST_CODE_RESOLVE_ERR);
                } catch (IntentSender.SendIntentException e) {
                    // Try connecting again. 
                    mConnectionResult = null;
                    mPlusClient.connect();
                } 
            } 
        } 
    } 
 
    private String getHangoutParticipants() {
        Person currentPerson = mPlusClient.getCurrentPerson();
        StringBuilder sb = new StringBuilder();
        sb.append("The crazy information people can get when you accept permissions:").append("\n");
        sb.append("Name:" + currentPerson.getDisplayName()).append("\n");
        sb.append("Birthday:" + currentPerson.getBirthday()).append("\n");
        Location mCurrentLocation = mLocationClient.getLastLocation();