public final class SmsIntent extends BaseIntent
BaseIntent builder implementation providing API for building and starting of intents
targeting an SMS sending related applications.
This intent builder requires only a phone number to be specified via phoneNumber(String).
DialerIntent| Modifier and Type | Field and Description |
|---|---|
static String |
URI_SCHEME
Uri scheme for SMS message targeting intents.
|
| Constructor and Description |
|---|
SmsIntent() |
| Modifier and Type | Method and Description |
|---|---|
CharSequence |
body()
Returns the body for SMS to send.
|
SmsIntent |
body(CharSequence body)
Sets a body for SMS to send.
|
protected void |
ensureCanBuildOrThrow()
Called to ensure that this builder can build its Intent from its current data.
|
protected Intent |
onBuild(Context context)
Invoked from
BaseIntent.build(Context) after BaseIntent.ensureCanBuildOrThrow() to build intent
specific for this intent builder from the current data. |
String |
phoneNumber()
Returns the phone number that will be passed to the SMS application.
|
SmsIntent |
phoneNumber(String number)
Sets a phone number that should be passed to the SMS application.
|
activityNotFoundMessage, activityNotFoundMessage, build, cannotBuildIntentException, dialogTitle, dialogTitle, enterTransition, enterTransition, exitTransition, exitTransition, isActivityForIntentAvailable, notifyActivityNotFound, onStartWith, startWith, transitionspublic static final String URI_SCHEME
Constant value: sms
public SmsIntent phoneNumber(String number)
number - The desired phone number. May be null to clear the current one.phoneNumber()public String phoneNumber()
phoneNumber(String)public SmsIntent body(CharSequence body)
body - The desired body text. May be null to clear the current one.body()public CharSequence body()
body(CharSequence)protected void ensureCanBuildOrThrow()
BaseIntent
If there are some required data missing/not specified, an exception indicating such state
should be thrown. The default exception may be created via BaseIntent.cannotBuildIntentException(String).
ensureCanBuildOrThrow in class BaseIntentprotected Intent onBuild(Context context)
BaseIntentBaseIntent.build(Context) after BaseIntent.ensureCanBuildOrThrow() to build intent
specific for this intent builder from the current data.onBuild in class BaseIntentcontext - Context obtained from the IntentStarter.