Skip to content

Most visited

Recently visited

navigation

TextUtilsCompat

public final class TextUtilsCompat
extends Object

java.lang.Object
   ↳ android.support.v4.text.TextUtilsCompat


Backwards compatible version of TextUtils.

Summary

Fields

public static final Locale ROOT

This field was deprecated in API level 26.0.0-beta1. This was never meant to be public. You can create your own empty Locale by calling the constructor with empty strings.

Public methods

static int getLayoutDirectionFromLocale(Locale locale)

Returns the layout direction for a given Locale

static String htmlEncode(String s)

Html-encode the string.

Inherited methods

From class java.lang.Object

Fields

ROOT

added in version 22.0.0
Locale ROOT

This field was deprecated in API level 26.0.0-beta1.
This was never meant to be public. You can create your own empty Locale by calling the constructor with empty strings.

Public methods

getLayoutDirectionFromLocale

added in version 22.0.0
int getLayoutDirectionFromLocale (Locale locale)

Returns the layout direction for a given Locale

Parameters
locale Locale: the Locale for which we want the layout direction, maybe be null.

Returns
int the layout direction, either LAYOUT_DIRECTION_LTR or LAYOUT_DIRECTION_RTL.

htmlEncode

added in version 22.0.0
String htmlEncode (String s)

Html-encode the string.

Parameters
s String: the string to be encoded

Returns
String the encoded string

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.