adding style dinamically to a TextView

by nou » Wed, 21 Apr 2010 06:54:27 GMT


Sponsored Links
 Hello

I have a String[] and I need to create a "paragraph" for each of the
strings in the array.

basically what I am doing at the moment is this:

      LinearLayout text = (LinearLayout)
this.findViewById(R.id.itemText);

      String[] ps = article.getATxt().split(Pattern.quote("\n"));

      for (String p : ps) {
         TextView newPar = new TextView(this);
         newPar.setPadding(0, 0, 0, 6);
         newPar.setText(p);
         text.addView(newPar);
      }

I am not happy with the way I format (padding) each new textView beign
created. I was wondering if there is a way to assign a style
dinamically so that I can extract from the code the styling.

Thanks

--



adding style dinamically to a TextView

by patbenatar » Wed, 21 Apr 2010 09:44:45 GMT


 This might help you:



Sponsored Links


Other Threads

1. Call Recording in Andriod ?

Hello Guys i want to know can we record phone calls in android and if
yes then can anybody provide me with some sample code or any other
info regarding this.

i read somewhere that call recording is blocked by android but even
then there are some call recording apps in the market for android.
so please help asap.. :)

thanks in advance.

Usman

-- 

2. changing AVD cause android.content.res.Resources$NotFoundException

Hello all,

I'm developpping an android application with eclipse and android
eclipse plugin, I was using a simple avd (version 1.6) without sd card
and all worked well (mean emulator launch and debug). But for sdcard
usage, I had to create a new avd 1.6 with sdcard, so I change my debug
configuration to use this new avd. The problem is when I debug, the
emulator is well launched, I had every time a
Resources.NotFoundException on the first line of code which use my
R.java file (even for a simple string)
It's like the codes in R.java aren't good, but I didn't change them.

If I return my debug configuration to the first avd 1.6 without sd
card, it works well again, even if I uninstall the application before.

Really don't understand...

Thanks in advance for your help

Thomas

--

3. map sdcard to drive letter or directory on windows

4. sorry cannot play this video!?

5. map sdcard to drive letter or directory on windows

6. map sdcard to drive letter or directory on windows

7. map sdcard to drive letter or directory on windows