PublishOptions
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Fields
public static final PublishOptions
DEFAULT
Public Methods
Gets the publishing callback.
public Strategy
getStrategy ()
Gets the publishing strategy.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003ePublishOptions\u003c/code\u003e configures how messages are published using \u003ccode\u003eMessages.publish()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUse \u003ccode\u003ePublishOptions.Builder\u003c/code\u003e to create instances, setting a strategy and callback.\u003c/p\u003e\n"],["\u003cp\u003eIt provides access to the publishing callback and strategy via \u003ccode\u003egetCallback()\u003c/code\u003e and \u003ccode\u003egetStrategy()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ePublishOptions.DEFAULT\u003c/code\u003e represents the default configuration.\u003c/p\u003e\n"]]],["`PublishOptions` configures the `Messages.publish` calls. Instantiate it using `PublishOptions.Builder`, setting the publishing strategy and callback with `setStrategy` and `setCallback`, and then calling `build`. It offers a `DEFAULT` option. Key actions include using `getCallback` to retrieve the publishing callback and `getStrategy` to obtain the publishing strategy. It inherits standard methods like `equals`, `hashCode`, and `toString` from the `Object` class.\n"],null,["# PublishOptions\n\npublic final class **PublishOptions** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nOptions for calls to [Messages.publish(GoogleApiClient, Message)](/android/reference/com/google/android/gms/nearby/messages/Messages#publish(com.google.android.gms.common.api.GoogleApiClient,%20com.google.android.gms.nearby.messages.Message)).\n\nUse the [PublishOptions.Builder](/android/reference/com/google/android/gms/nearby/messages/PublishOptions.Builder)\nto create an instance of this class, e.g.: \n\n PublishOptions options = new PublishOptions.Builder()\n .setStrategy(someStrategy)\n .setCallback(myCallback)\n .build();\n \n### Nested Class Summary\n\n|-------|---|---|----------------------------------------------------------------------------------------------------------------------|\n| class | [PublishOptions.Builder](/android/reference/com/google/android/gms/nearby/messages/PublishOptions.Builder) || Builder for instances of [PublishOptions](/android/reference/com/google/android/gms/nearby/messages/PublishOptions). |\n\n### Field Summary\n\n|----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------|---|\n| public static final [PublishOptions](/android/reference/com/google/android/gms/nearby/messages/PublishOptions) | [DEFAULT](/android/reference/com/google/android/gms/nearby/messages/PublishOptions#DEFAULT) | |\n\n### Public Method Summary\n\n|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [PublishCallback](/android/reference/com/google/android/gms/nearby/messages/PublishCallback) | [getCallback](/android/reference/com/google/android/gms/nearby/messages/PublishOptions#getCallback())() Gets the publishing callback. |\n| [Strategy](/android/reference/com/google/android/gms/nearby/messages/Strategy) | [getStrategy](/android/reference/com/google/android/gms/nearby/messages/PublishOptions#getStrategy())() Gets the publishing strategy. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFields\n------\n\n#### public static final PublishOptions\n**DEFAULT**\n\nPublic Methods\n--------------\n\n#### public [PublishCallback](/android/reference/com/google/android/gms/nearby/messages/PublishCallback)\n**getCallback** ()\n\nGets the publishing callback. \n\n#### public [Strategy](/android/reference/com/google/android/gms/nearby/messages/Strategy)\n**getStrategy** ()\n\nGets the publishing strategy."]]