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

Slow motion video preview with Android MediaRecorder
Android Re-create service at given intervals using AlarmManager
What is the difference between triggers and events in Android
Button background image is not showing from resource of another application
Resize Image Proportionally on Orientation Change
url.openConnection() does not open the connection to the server
View.OnTouchListener and screen rotation coordination
character mapping in edittext android
how Edittext onclick listener works?
ClassCastException when primarykey is short in greendao
How to subtract two calendar object in Android
How to set custom list view item's height? [Solved]
Implement options menu in Fragment Activity
How to add EditText value in arraylist in Custom ListView
Receive touch event on any screen
Is it possible to automate pre-installed android apps such as Gallery, Clock, etc. using Selendroid?

Categories

HOME
eclipse
porting
gridview
prism
ggplot2
swt
components
pclxl
owl-carousel
limit
google-admin-sdk
jax-ws
appcelerator-studio
google-form
speech-synthesis
enterprise-architect
event-sourcing
scsi
jersey-1.0
pyramid
sigma.js
sencha-touch
replication
googlebot
guzzle
squashfs
jquery-ias
epsilon
monit
draft-js-plugins
tiki-wiki
syntax-highlighting
flooding
linked-data
android-things
spotipy
twiml
python-2.6
sql-server-2000
hibernate-validator
wacom
linkedhashmap
hard-drive
github3.py
python-import
sql-delete
google-earth-engine
xdocreport
typesafe-config
opensmpp
trigonometry
plaintext
tcc
xmldocument
show-hide
monkey-testing
robomongo
x-ray
libjpeg
flac
cpu-cache
restore
flex-monkey
myspace
burrows-wheeler-transform
windows-azure-queues
dbamp
fuzzywuzzy
grass
file-move
canalyzer
airbrake
zend-currency
gamekit
ejb-2.x
nodelist
spy++
human-computer-interface
raygun
extjs2
unit-of-work
superscrollorama
cascadingdropdown
intersect
android-loadermanager
zope.interface
dajaxice
google-maps-mobile
matlab-load
fsevents
massive
metaweblog
objective-j
updatesourcetrigger
dot-emacs
ajax-polling
mathematical-notation
xpsdocument
java1.4
soappy
great-circle
pnrp

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