Search code examples
androidgoogle-plusgoogle-plus-one

Android Follow google+ page directly through button


I want to put one button to follow my google plus page through click on that button, means when i click on Google+ button that automatically follow my page, i much goggling but not find
exact,so any one please help me to solve it.


Solution

  • Sorry ! There is no custom button for a Google+ following page.i think, i am using below code is useful for you. this code is directly open Google+ page and default follow button.

    public void openGPlus(String profile) {
        try {
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setClassName("com.google.android.apps.plus",
                    "com.google.android.apps.plus.phone.UrlGatewayActivity");
            intent.putExtra("customAppUri", profile);
            startActivity(intent);
        } catch (ActivityNotFoundException e) {
            startActivity(new Intent(Intent.ACTION_VIEW,
                    Uri.parse("https://plus.google.com/" + profile + "/posts")));
        }
    }
    

    call this method such as openGPlush("numeric page id");