The Android interface for text that has markup objects attached to ranges of it.
Questions tagged [spanned]
87 questions
2
votes
1 answer
Edit Spanned Text
I need to design an editor for my project that allow user to style some part of the text.
I have used an EditText and bold selected text by adding following codes in onClickListener of a button.
String selectedText = "" +…

Mostafa Lavaei
- 1,960
- 1
- 18
- 27
2
votes
1 answer
Set textview from returned value
I am creating a horizontal string which have colored bullet point between each text. The method which I've uses Spanned StringBuilder and return value as Html.fromHtml(builder.toString()). The problem is how to use that return value to set text in…

Sam
- 49
- 1
- 8
2
votes
0 answers
Displaying drawable in textview alongside text
I have a custom implementation of emoticons for an upcoming app. I want the user to select an emoji, which will then be inserted in an edittext and he can the add more text to his liking. When the user clicks on a button, I want to add the edittext…

mungaih pk
- 1,809
- 8
- 31
- 57
2
votes
0 answers
Images overlapping text in Spanned Html.fromHtml in Kitkat but not Lollipop
I am using Html.ImageGetter to insert images into spanned HTML.
When I run the app on Android Emulator (Lollipop, it renders fine.
Running the app on my phone KitKat causes (may a times) images to overlap (and hide text).
Going through docs, I…

xyz
- 3,349
- 1
- 23
- 29
2
votes
1 answer
Save only Bolded Text to a String Array in a Spanned String?
I have paragraph long stories that contain spanned strings with mostly regular text and a few bolded text (1 or 2 words) here and there. It's in an Edittext. I want to be able to search through that spanned string in the editText and save each…

sanic
- 2,065
- 4
- 20
- 33
2
votes
4 answers
working with Strings - how can I make "small numbers" in the upper part like in real books - is it possible?
Sorry , my English is not enough to explain clearly what I want, maybe that's why I can't find answer in the Google.
When you use real book - sometimes you have some text there that needs an explanation and after that text you have "*" sign and an…

Vlad Alexeev
- 2,072
- 6
- 29
- 59
2
votes
0 answers
Newlines in a TextView using a Spannable
I have got the following issue. I have a String which I want to display in a TextView. Because the String can be HTML formatted I am using a Spanned like so:
TextView tv = (TextView)findViewById(R.id.Description);
Spanned myDescription =…

Lieuwe
- 1,734
- 2
- 27
- 41
1
vote
1 answer
How to concat two Strings with different textAppearance in a TextView?
Now I have this code:
TextView textView = (TextView) convertView.findViewById(R.id.label);
String html = name + " - " + description + "";
textView.setText(Html.fromHtml(html));
Where textView has…

Brais Gabin
- 5,827
- 6
- 57
- 92
1
vote
1 answer
Android Spanned getSpanEnd() returns wrong value
I am using Html.fromHtml to parse some html string, and then going through the spans, I am looking to find the start and end of each span. I noticed that for tags the getSpanEnd returns the same value as start. Does anyone know how can I get the…

Raphael C
- 2,296
- 1
- 22
- 22
1
vote
1 answer
How do I get the size of text at a specified index of a TextView?
I'm using a TextView that has a Spannable object as the text and has multiple different text sizes. I want to know how do I get the text size at a specified index. If I use the TextView.getPaint() and get the text size from there, it always uses the…

Jason Robinson
- 31,005
- 19
- 77
- 131
1
vote
2 answers
Can not set NOT NULL to column with type ARRAY
I have a Table with column of type:
ARRAY
All data have a value, but i can not set NOT NULL.
ALTER TABLE Organizations ALTER COLUMN superfinUsersList ARRAY NOT NULL
error: Cannot add NOT NULL to column…

Chipintoza
- 295
- 4
- 16
1
vote
1 answer
Spanned string loses bold style when adding characters
I set the following text and style in my EditText:
SpannableStringBuilder sb = new SpannableStringBuilder();
sb.append("Hello");
sb.setSpan(new StyleSpan(Typeface.BOLD), 0, 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
sb.append("World…

Andreas
- 9,245
- 9
- 49
- 97
1
vote
0 answers
Superscripting with SpannableStringBuilder
i'm making a math tool, and i've run into a bit of trouble with the graphical representation of it.
I'm trying to superscript some strings, and the method i'm using is
tV = (TextView) findViewById(R.id.textView);
String textEAS;
…

Dber
- 21
- 1
1
vote
1 answer
I have a Spanned text with some formatting. How do I convert it into a String based on that formatting?
Spanned spanned = article.getArticleBody();
TextView body =(TextView) rootView.findViewById(R.id.article_body);
How do I print this in body TextView
user8557806
1
vote
1 answer
How to pass Spanned Data-type data using Intent
I am passing some data from one activity to another. All the data are passing alright but there one with data type Spanned which isnt working at all.
When I display it in the first Activity,it works but when I display it in the other activity,it…

A-Majeed
- 27
- 10