public static class ContentIntent.ContentHandler extends Object
ContentIntent
builder. Such an item will be than displayed in a chooser dialog with all added handler items.
Each ContentHandler must have its name specified that will be displayed in a list item's view.
There must be also specified an intent that will be started whenever an item of a particular
handler is clicked.ContentHandler#ContentHandler(CharSequence, Intent)| Constructor and Description |
|---|
ContentHandler(CharSequence name,
android.content.Intent intent)
Creates a new instance of ContentHandler with the specified name and intent.
|
| Modifier and Type | Method and Description |
|---|---|
android.content.Intent |
intent()
Returns the intent specified for this handler.
|
CharSequence |
name()
Returns the name of this handler.
|
int |
requestCode()
Returns the request code specified for this handler.
|
ContentIntent.ContentHandler |
requestCode(int code)
Sets a request code used when starting the intent specified during initialization.
|
public ContentHandler(CharSequence name, android.content.Intent intent)
Note, that the given intent will be started via
IntentStarter.startIntent(Intent) or via IntentStarter.startIntentForResult(Intent, int)
if the request code specified via requestCode(int) is none-negative number.
name - Name of the new "content handler" to be displayed within chooser dialog
list.intent - Intent to be started when an item associated with this handler within
chooser dialog is clicked.public CharSequence name()
public android.content.Intent intent()
public ContentIntent.ContentHandler requestCode(int code)
code - The desired request code. This code should be used to identify result from
started intent in Activity.onActivityResult(int, int, Intent) or
Fragment.onActivityResult(int, int, Intent), depends on from within
which context has been ContentIntent started.requestCode()public int requestCode()
requestCode(int)