adding style dinamically to a TextView

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

Sponsored Links

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)

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

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

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.



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. Some comment spam squashed?

My app, along with dozens of others, has seen comment spam from a
referral service of for the last few months. Google has
been removing the messages pretty fast but they recently changed their
tactics and domain name so the spam comments have built up to
despicable levels.

To fight this, I tried sending a message to through their
contact form, however, that met with no response from them so I dug a
little deeper and found the direct e-mail address of the chairman of, Andrew Weinreich through another one of his companies
called Xtify. I sent him the following message:


Pardon the direct contact.

You should know that <name omitted> has been spamming the Android
market with a campaign designed to get users to sign up with what
appears to be I certainly hope they are nothing more than
a referral service and not something started by your company.

The spam they are delivering is in the form of comments on apps
available on the Android market. This despicable tactic pollutes the
Android market and causes untold anguish to the community. You can see
it on pretty much every popular application, including my own "Radar
Now!" which is seeing this posted every single day.

I implore you to get this affiliate <name omitted> to stop this
tactic as it's against the Android market terms of service, and
hopefully your own.

Here are a few links to the spam messages: (click on User Reviews)

There are dozens of other apps with similar spam messages.

If you care about your corporate name and reputation, you'll do
something about this menace.

-John Coryat, president, USNaviguide LLC

His response was:


I'm very appreciative of the direct contact.  I wasn't aware of the
spam and have made it high priority here to make sure we immediately
terminate the relationship with the affiliate who is violating our
marketing practices.

Thanks for taking the time to write me.



Hopefully, this will kill off this annoying and persistent spammer.
I'm sure some other low life will take their place.

The only way to fight these creatures is to hit them in the pocket
books. If we just ignore them and accept this type of behavior as
normal, it will get worse and decrease the user experience.

-John Coryat


2. [wta] setelah di inject knp masih sinyal 1x??

sore suhu2 android..
mau nanya kenapa droid ane setelah di inject smart kok dapet sinyal 1x aja
di pancing juga muncul 3g setelah beberapa detik kok balik lagi ke 1x...
mohon bimbingan suhu-suhu agar droid ane bisa merasakan ganasnya kecepatan
3g smart...

thx before,,,


3. Fetch data from android service to HTML

4. Voice Recording : OpenCore OSCL Scheduler

5. Ginger bread - NFC Card Emulation & p2p

6. Focus and raise keyboard for Dialog with EditText

7. Server Response