Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Ctors](https://developer.android.com/reference/android/text/BidiFormatter.Builder#pubctors) \| [Methods](https://developer.android.com/reference/android/text/BidiFormatter.Builder#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/text/BidiFormatter.Builder#inhmethods)

# BidiFormatter.Builder

*** ** * ** ***


`
public
static
final

class
BidiFormatter.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.text.BidiFormatter.Builder |

<br />

*** ** * ** ***

A class for building a BidiFormatter with non-default options.

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/text/BidiFormatter.Builder#Builder()() ` Constructor. |
| ` https://developer.android.com/reference/android/text/BidiFormatter.Builder#Builder(boolean)(boolean rtlContext) ` Constructor. |
| ` https://developer.android.com/reference/android/text/BidiFormatter.Builder#Builder(java.util.Locale)(https://developer.android.com/reference/java/util/Locale locale) ` Constructor. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/text/BidiFormatter` | ` https://developer.android.com/reference/android/text/BidiFormatter.Builder#build()() ` |
| ` https://developer.android.com/reference/android/text/BidiFormatter.Builder` | ` https://developer.android.com/reference/android/text/BidiFormatter.Builder#setTextDirectionHeuristic(android.text.TextDirectionHeuristic)(https://developer.android.com/reference/android/text/TextDirectionHeuristic heuristic) ` Specifies the default directionality estimation algorithm to be used by the BidiFormatter. |
| ` https://developer.android.com/reference/android/text/BidiFormatter.Builder` | ` https://developer.android.com/reference/android/text/BidiFormatter.Builder#stereoReset(boolean)(boolean stereoReset) ` Specifies whether the BidiFormatter to be built should also "reset" directionality before a string being bidi-wrapped, not just after it. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Public constructors

### Builder

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder ()
```

Constructor.

<br />

### Builder

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (boolean rtlContext)
```

Constructor.

<br />

| Parameters ||
|---|---|
| `rtlContext` | `boolean`: Whether the context directionality is RTL. <br /> |

### Builder

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (Locale locale)
```

Constructor.

<br />

| Parameters ||
|---|---|
| `locale` | `Locale`: The context locale. <br /> |

## Public methods

### build

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BidiFormatter build ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/text/BidiFormatter` | A BidiFormatter with the specified options. <br /> |

### setTextDirectionHeuristic

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BidiFormatter.Builder setTextDirectionHeuristic (TextDirectionHeuristic heuristic)
```

Specifies the default directionality estimation algorithm to be used by the BidiFormatter.
By default, uses the first-strong heuristic.

<br />

| Parameters ||
|---|---|
| `heuristic` | `TextDirectionHeuristic`: the `TextDirectionHeuristic` to use. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/text/BidiFormatter.Builder` | the builder itself. <br /> |

### stereoReset

Added in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public BidiFormatter.Builder stereoReset (boolean stereoReset)
```

Specifies whether the BidiFormatter to be built should also "reset" directionality before
a string being bidi-wrapped, not just after it. The default is true.

<br />

| Parameters ||
|---|---|
| `stereoReset` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/text/BidiFormatter.Builder` | <br /> |