It can be achieved if you are using a string resource xml file, which supports HTML tags like <b></b>
, <i></i>
and <u></u>
.
<resources> <string name="your_string_here">This is an <u>underline</u>.</string> </resources>
If you want to underline something from code use:
TextView textView = (TextView) view.findViewById(R.id.textview); SpannableString content = new SpannableString("Content"); content.setSpan(new UnderlineSpan(), 0, content.length(), 0); textView.setText(content);
Related Posts:
- You need to use a Theme.AppCompat theme (or descendant) with this activity
- You need to use a Theme.AppCompat theme (or descendant) with this activity
- How do I remove the title bar from my app?
- Why fragments, and when to use fragments instead of activities?
- Font size of TextView in Android application changes on changing font size from native settings
- Error inflating class fragment
- How to build a horizontal ListView with RecyclerView
- Getting activity from context in android
- Android LinearLayout Gradient Background
- How to customize a Spinner in Android
- How to remove title bar from the android activity?
- What does ellipsize mean in android?
- What are the differences between LinearLayout, RelativeLayout, and AbsoluteLayout?
- What is the difference between “px”, “dip”, “dp” and “sp”?
- How to inflate one view with a layout
- How do I get the currently displayed fragment?
- What exactly does fitsSystemWindows do?
- Determining translationX/Y values for ObjectAnimator; how to move a view to an exact screen position?
- What is the difference between gravity and layout_gravity in Android?
- Closing Application with Exit button
- How to change the color of a button?
- Scrollview can host only one direct child
- How to remove title bar from the android activity?
- Failed to find style ‘coordinatorLayoutStyle’ in current theme
- ‘App not Installed’ Error on Android
- ‘App not Installed’ Error on Android
- Can’t start Eclipse – Java was started but returned exit code=13
- google console error `OR-IEH-01`
- Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm
- How to display Toast in Android?
- ‘adb’ is not recognized as an internal or external command, operable program or batch file
- Flutter pageview : Find first and last page and swipe directions
- Enable VT-x in your BIOS security settings (refer to documentation for your computer)
- NetworkType.UNMETERED vs NetworkType.METERED – PeriodicWork
- how to overcome Android Studio cannot resolve symbol for android classes
- ADB Android Device Unauthorized
- Execution failed app:processDebugResources Android Studio
- How can I use adb over WiFi?
- SQLiteDatabase.query method
- Android ADB device offline, can’t issue commands
- Android SDK location
- Android Studio Run/Debug configuration error: Module not specified
- Android Emulator Error Message: “PANIC: Missing emulator engine program for ‘x86’ CPUS.”
- IllegalArgumentException: Unable to locate adb in Android Studio v2.3
- How to set the text color of TextView in code?
- What is the “AdMob Offline Notifications” notification channel?
- Why am I seeing net::ERR_CLEARTEXT_NOT_PERMITTED errors after upgrading to Cordova Android 8?
- A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
- How to create a Custom Dialog box in android?
- Unfortunately Launcher3 has stopped working error in android studio?
- Getting weather info feeds from accuweather
- adb command not found
- Activity, AppCompatActivity, FragmentActivity, and ActionBarActivity: When to Use Which?
- “cannot resolve symbol R” in Android Studio
- Android basics: running code in the UI thread
- Emulator for Amazon Kindle
- What is difference between SQLite and SQL
- Change status bar text color when primaryDark is white
- How can you make a custom keyboard in Android?
- How to convert int to Integer
- “ArrayAdapter requires the resource ID to be a TextView” XML problems
- android.content.ActivityNotFoundException: Unable to find explicit activity class
- Dialog throwing “Unable to add window — token null is not for an application” with getApplication() as context
- ADB stopping at (waiting for devices)
- How can I get the android-support-v4.jar file (from Android Support Library) on Linux?
- What is the meaning of android.intent.action.MAIN?
- Disable back button in android
- Is there a way to get the source code from an APK file?
- How to clear gradle cache?
- Converting pixels to dp
- ViewText in Android
- How do I download the Android SDK without downloading Android Studio?
- Android SDK location should not contain whitespace, as this cause problems with NDK tools
- How can I open a URL in Android’s web browser from my application?
- ‘dependencies’ cannot be applied to ‘(groovy.lang.Closure)’
- Is it possible to use published instant apps(BuzzFeed, Wish, etc) on the emulator?
- Why this line xmlns:android=”http://schemas.android.com/apk/res/android” must be the first in the layout xml file?
- Difference between getContext() , getApplicationContext() , getBaseContext() and “this”
- Android Studio – No Target Device Found
- Android Overriding onBackPressed()
- Default FirebaseApp is not initialized
- How can I create simple accordion with Angular 2?
- Error inflating class android.support.design.widget.FloatingActionButton
- How do I parse JSON in Android?
- Cannot resolve symbol ‘AppCompatActivity’
- Reverse engineering from an APK file to a project
- Change the project theme in Android Studio?
- setBackgroundDrawable() deprecated
- Exception ‘open failed: EACCES (Permission denied)’ on Android
- How to disable Instant Run for Android Studio 3.0
- I can’t find adb_usb.ini file in .android folder?
- Android; Check if file exists without creating a new one
- How to open adb and use it to send commands
- Unable to add window — token null is not valid; is your activity running?
- How to determine the version of Gradle?
- Call requires permissions that may be rejected by user
- sendUserActionEvent() is null
- SDK Location not found in android studio
- Android app unable to start activity componentinfo