public static class

PlusShare.Builder

extends Object
java.lang.Object
   ↳ com.google.android.gms.plus.PlusShare.Builder

Summary

Public Constructors
PlusShare.Builder()
Create a new Builder for launching a sharing action.
Public Methods
PlusShare.Builder addStream(Uri streamUri)
Add a stream URI to the data that should be shared.
static PlusShare.Builder from(Activity launchingActivity)
Create a new Builder for launching a sharing action from launchingActivity.
Intent getIntent()
Retrieve the Intent as configured so far by the Builder.
PlusShare.Builder setContent(Uri deepLinkUri)
Include a deep-link URI to a resource to share on Google+
PlusShare.Builder setContent(String deepLinkId, String title, String description, Uri thumbnailUri)
Include a deep-link identifier to a resource to share on Google+
PlusShare.Builder setStream(Uri streamUri)
Set a stream URI to the data that should be shared.
PlusShare.Builder setText(CharSequence text)
Set the literal text data to be sent as part of the share.
PlusShare.Builder setType(String mimeType)
Set the type of data being shared.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PlusShare.Builder ()

Create a new Builder for launching a sharing action.

Public Methods

public PlusShare.Builder addStream (Uri streamUri)

Add a stream URI to the data that should be shared. If this is not the first stream URI added the final intent constructed will become an ACTION_SEND_MULTIPLE intent. Not all apps will handle both ACTION_SEND and ACTION_SEND_MULTIPLE.

Parameters
streamUri URI of the stream to share.
Returns
  • This Builder for method chaining.

public static PlusShare.Builder from (Activity launchingActivity)

Create a new Builder for launching a sharing action from launchingActivity.

Parameters
launchingActivity Activity that the share will be launched from
Returns
  • a new Builder instance

public Intent getIntent ()

Retrieve the Intent as configured so far by the Builder. This method will include the package

Returns
  • The current Intent being configured by this builder

public PlusShare.Builder setContent (Uri deepLinkUri)

Include a deep-link URI to a resource to share on Google+

Parameters
deepLinkUri The deep-link URI to a resource to share on Google+.
Returns
  • This Builder for method chaining.

public PlusShare.Builder setContent (String deepLinkId, String title, String description, Uri thumbnailUri)

Include a deep-link identifier to a resource to share on Google+

Parameters
deepLinkId The deep-link identifier to a resource to share on Google+. This parameter is required.
title The title of the resource. This parameter is required.
description The description of a resource. This parameter is required.
thumbnailUri The thumbnailUri for a resource. This parameter is optional.
Returns
  • This Builder for method chaining.

public PlusShare.Builder setStream (Uri streamUri)

Set a stream URI to the data that should be shared.

This replaces all currently set stream URIs and will produce a single-stream ACTION_SEND intent.

Parameters
streamUri URI of the stream to share
Returns
  • This Builder for method chaining
See Also

public PlusShare.Builder setText (CharSequence text)

Set the literal text data to be sent as part of the share. This may be a styled CharSequence.

Parameters
text Text to share
Returns
  • This Builder for method chaining
See Also

public PlusShare.Builder setType (String mimeType)

Set the type of data being shared.

Parameters
mimeType mimetype of the shared data
Returns
  • This Builder for method chaining
See Also
No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.