PlusShare.Builder | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Languages
close

- - Get Started
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
    - Get the SDK
  - Google Services
- - Google Play
  - Publishing
  - Promoting
  - App Quality
  - Spotlight
  - Open Distribution

## Results

Loading...
Summary: Ctors | Methods | Inherited Methods | [Expand All]
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
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## 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.

##### See Also

- `EXTRA_STREAM`
- `ACTION_SEND`

#### 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.

##### See Also

- `from(android.app.Activity)`

#### 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.

##### See Also

- `from(android.app.Activity)`

#### 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

- `EXTRA_STREAM`

#### 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

- `EXTRA_TEXT`

#### 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

- `setType(String)`