java.lang.Object | |
↳ | com.google.android.gms.fitness.ViewSessionIntentBuilder |
Builder of intents to view sessions
stored in Google Fit.
This intent can be used when the application wants to display a more detailed view of a
particular session.
Apps that can display sessions (such as the app that inserted the session) can register for the
given intent.
setPreferredApplication(String)
.
The session view intent has the following attributes:
ACTION_VIEW
MIME_TYPE_SESSION_PREFIX
followed by the activity for
the session. For example vnd.google.fitness.session/running
would represent a running
session.
<activity android:name="com.example.ViewSessionActivity" android:exported="true"> <intent-filter> <action android:name="vnd.google.fitness.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.google.fitness.session/biking" /> <data android:mimeType="vnd.google.fitness.session/running" /> </intent-filter> </activity>
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the built intent, which can be used with
startActivity(Intent) to
launch the desired Fitness activity. | |||||||||||
Sets a preferred application to use for this intent.
| |||||||||||
Sets the session to display data for.
|
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns the built intent, which can be used with startActivity(Intent)
to
launch the desired Fitness activity.
IllegalStateException | if not enough data has been passed into the Builder to build a valid intent. |
---|
Sets a preferred application to use for this intent. If the given app is installed and able to handle this intent, an explicit intent will be returned.
By default, the intent will attempt to use the application which inserted the session. Use this method only to override that behavior.packageName | the package name for the application we want to link to, or null
to not prefer any application |
---|
Sets the session to display data for. A specific session must be set.
session | the specific session we wish to display data for |
---|