Android access to Google + share features

Source: Internet
Author: User

Android uses Google + share features

1. First import the <android-sdk-folder>/extras/google/google_play_services into Eclipse


If you do not have this project first update to the latest ADT, then open the Android SDK manager to download


2. Add it as a Lib project to our project


3. Main share code:

Google + share public void Dogoogleplusshare (Activity mcontext) {//Determine if Google Serviceif is installed ( Googleplayservicesutil.isgoogleplayservicesavailable (mcontext) = = connectionresult.success) {Intent shareIntent = New Plusshare.builder (Mcontext). SetType ("Text/plain"). SetText ("Test Share"). Setcontenturl (Uri.parse ("    Www.baidu.com ")). Getintent (); Mcontext.startactivityforresult (shareintent,0);} Else{toast.maketext (Mcontext, "Please install Google Service", 0). Show ();}}


This article is from the "birds learn C to Dapeng" blog, please be sure to keep this source http://vincenttung.blog.51cto.com/6249439/1587682

Android access to Google + share features

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.