An Android Spannable is an interface for text to which markup objects can be applied.
Questions tagged [spannable]
302 questions
0
votes
1 answer
How to make text underline and remove text at the same time
I have a text in which there is indicator tag that indicate from where i will make text underline, I want to make text underline from that indicator also want to remove indicator so that it wont appear in string, here is what I'm trying:
String…

blackHawk
- 6,047
- 13
- 57
- 100
0
votes
3 answers
Highlight Certain Text Background In Text View With Case Insensitive
I want to highlight certain text background with some color with case insensitive. I tried the code below but it's not working. It only highlights when the keyword is in lowercase.
private static CharSequence highlightText(String search, String…

Mei Yi
- 341
- 3
- 14
0
votes
1 answer
How to change span position automatically, if some text added before spanned text in EditText?
Am creating an application in which edittext adds style span to certain positions of text
editable.setSpan(new StyleSpan(Typeface.BOLD), start, start+replacement.length(),Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
My issue is that if user adds, some text…

Bincy Baby
- 3,941
- 5
- 36
- 62
0
votes
1 answer
Multiple BackgroundColorSpan shown wrongly Android API 24 25
I use BackgroundColorSpan to show multiple highlights for a TextView. It shows correctly on Android API 23 and below, but has a problem with API 24 and 25.
final static String article1 = "Last year’s Google Pixel and Pixel XL were without question "…

Eric
- 1
- 1
0
votes
0 answers
HTML.TagHandler is not detecting Android Supported Html tags like and
I am new to Android and learned everything from StackOverflow but I am Stuck here. The Html.TagHandler is not detecting any HTML tags like < p> ,< b>,etc apart from < img> tags like shown in the Logcat. I have to use < p> tag for using Custom fonts.…

ASH
- 75
- 1
- 12
0
votes
1 answer
background color span not saved in sqlite android for API less than 25
I wanted to highlight part of my edit text like so:-
mySpannablestring.setSpan((new
BackgroundColorSpan(color)),0,mySpannablestring.length(),0);
//then set to editext
editext.setText(mySpannablestring);
I saved it as a String to database using…

Omar Boshra
- 447
- 7
- 21
0
votes
1 answer
Android EditText failed to wrap text for a space followed by a long link
I found this problem reproducible on many apps e.g. Twitter for Android. If we have this long link https://example.com/test/path/123456789012345678901234567890, when we pasting it into an EditText, it will look like this:
But if we insert a space…

mariotaku
- 693
- 1
- 10
- 26
0
votes
0 answers
How to use Spannable in SurfaceView
We can use Spannable to adjust text color, font and background in TextView and EditView. But now I want to use it in SurfaceView, there are some images and texts in my SurfaceView. I want to implements the following picture's function, I have…

jiabao
- 105
- 1
- 10
0
votes
6 answers
Add another Word in TextView Android
I have one sentence with 3 TextView in my RecyclerView. The picture is like below :
In that picture, I have one sentence in 3 TextView, there are "1" "HOT, MORE CHILLI" and "Pizza". This is my RecyclerView Binding code :
try {
…

MrX
- 953
- 2
- 16
- 42
0
votes
2 answers
TextView setTextIsSelectable(true) crashing application
I wanted to make my data in textview selectable for copy paste. For this,
I am setting textIsSelectable flag to true in my textview as following:
textView.setText("Hello");
textView.setTextIsSelectable(true);
I am getting following…

HimanshuGargas
- 46
- 6
0
votes
1 answer
What is flag variable in building SpannableStringBuilder
I read flags parameter in google docs, but I can't find what exactly it's doing.
For example in below code:
SpannableStringBuilder builder1 = new SpannableStringBuilder();
builder1.append("hi");
builder1.append("this is test");
builder1.setSpan(new…

Hojjat
- 815
- 1
- 10
- 25
0
votes
2 answers
Filtered Spannable text doesn't working in my case
Hello I have follow this link How to highlight filtered text in RecyclerView when using SearchView widget to make custom filtered list in recyclerview. But it doesn't work to my case, what's wrong with my code? I''ll really apreciate if you can look…

Mohamad Firdaus
- 1
- 3
0
votes
3 answers
Change TextView to clickable words in a custom ListView
I have a custom List in which different buttons are present on each List.
my aim is to make a single text view

phpdroid
- 1,642
- 1
- 18
- 36
0
votes
1 answer
android spannable viewholder
I'm coding an application and just trying to get a spannable string in a viewholder.My code works except that the police color doesn't change.
Where do I go wrong ?
Thanks
public class MyListAdapter extends ArrayAdapter{
int…

filoman
- 17
- 6
0
votes
1 answer
Implementing "search within page" on Android
In my application I would like to be able to allow the user to search the contents of a scrollable TextView with a fair bit of content in it (essentially an article). Much like the "search in page" functionality on a web browser, whereby the user…

Chris Ward
- 101
- 7