android


How to set this html String to textview with textcolor in android? [closed]


String data="<span style=\"color:#a52a2a;\">युद्ध प्रारंभ होने से पूर्व युधिष्ठिर रथ </span>से उतरकर पैदल ही पितामह भीष्म के पास गए तथा उनके चरणस्पर्श करके उन्हें प्रणाम किया। इसी प्रकार युधिष्ठिर ने कृपाचार्य और द्रोणाचार्य को भी प्रणाम किया तथा विजय का आशीर्वाद प्राप्त किया। युधिष्ठिर की धर्म-नीति को देखकर धृतराष्ट्र का पुत्र युयुत्सु इतना प्रभावित हुआ कि कौरन-सेना छोड़कर पांडवों से जा मिला।\n" +
"<h2>\n" +
"\tपहले दिन का युद्ध</h2>\n";
need this text in textview with color..
I just want to set this html to textview with his attribte and color and size
To set HTML in the TextView:
myTextView.setText(Html.fromHtml("<span style=\"color:#a52a2a;\">युद्ध प्रारंभ होने से पूर्व युधिष्ठिर रथ </span>से उतरकर पैदल ही पितामह भीष्म के पास गए तथा उनके चरणस्पर्श करके उन्हें प्रणाम किया। इसी प्रकार युधिष्ठिर ने कृपाचार्य और द्रोणाचार्य को भी प्रणाम किया तथा विजय का आशीर्वाद प्राप्त किया। युधिष्ठिर की धर्म-नीति को देखकर धृतराष्ट्र का पुत्र युयुत्सु इतना प्रभावित हुआ कि कौरन-सेना छोड़कर पांडवों से जा मिला।\n" +
"<h2>\n" +
"\tपहले दिन का युद्ध</h2>\n", Html.FROM_HTML_MODE_COMPACT));
To change the color of the TextView:
holder.text.setTextColor(Color.BLUE);
How to display HTML in TextView? that would help you in setting the HTML to textview . And in the xml part of the textview simply type textcolor and it'll suggest you to add Android:textColor where you specify the appropriate color for you text

Related Links

Programmatically Set Background Resource of EditText to transparent field
AndEngine how to put 2 OnScreenControl?
Android get value from ArrayList
Android MediaCodec API - Music Plays on Emulator, Not on the Device
Confusion about AlarmManager's CPU lock in android
Android RadialGradient is getting corrupted
connecting SQL database to android
How to force RadioGroup to select only one RadioButton at a time programatically?
Is there any difference between “TypedValue.COMPLEX_UNIT_DIP” and “dp in xml”?
Post message on my friends wall with sdk 3.5 android
Android SDK is missing, out of date, or is missing templates. Please ensure you are using SDK version 22 or later
Generating touch events from a background service in android
The sound jerk when playing video
several charts in single webview
Styling android Listview in android
How to tweet on Twitter from my Android Application

Categories

HOME
delphi-7
awk
ng-idle
github-for-windows
sublimetext
r-googlesheets
replace
edge
rds
3d-reconstruction
hugo
settings
tvos
modal-dialog
recordrtc
joomla3.0
p2p
plist
android-securityexception
windows-ce
endpoint
docx
mathprog
html5-appcache
jersey-1.0
identity-management
cfml
delphi-xe5
sencha-touch
solrcloud
joptionpane
hta
comparator
ckfinder
outliers
android-maps
intersystems-cache
errbot
android-sugarorm
gojs
baidu-map
fiware-cygnus
roblox
wurfl
flatmap
apns-php
cin
c9.io
news
softmax
install.packages
dapper-simplecrud
phpdbg
activeperl
manova
lightning
video-conferencing
context-sensitive-grammar
android-testing
git-flow
otp
cpu-cache
offline.js
gameplay-kit
ampps
renaming
atlas
spring-cloud-feign
spreadjs
beanstalk
relativelayout
linklabel
django-urls
include-guards
poppler
evolus-pencil
amiga
ocra
jsvc
alloy-ui
matlab-deployment
diff3
j-security-check
xmltype
bcache
addressing-mode
contrast
formview
appserver
jama
xml-dsig
ray
twitter-bootstrap-rails
gae-quotas
multitasking
gwt-openlayers
http-patch
kendo-dataviz
breakout
asdf
time.h
onload-event
garbage
apache-whirr
relative
listactivity
umra
undefined-index
dot-emacs
web-garden
strtod
purepdf
feasibility
sifr3
soappy
information-management
movieplayer
pbcopy

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App