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. cable web connection through computer

Hi all,
I don't have an Android phone but I'm considering buying it. I just
wanted to know if it is possible to connect the device to internet (or
just synching GMail and Calendar)  through a computer which is already
on Internet (by a LAN cable, for example).

I'm asking this because I'm already connected to internet by computer
the whole day, and it wouldn't make much sense to pay for an internet
connection for the mobile just to sync data I can already see.

I know Wi-Fi works on Android, but where I work it is not available.

Thanks a lot!

--~--~---------~--~----~------------~-------~--~----~

2. Connect to my own pc

How can i connect on a port of my own pc?

error: java.net.ConnectException: /ipadress:port - Connection refused

-- 
Wagner Amaral e Silva
planinfo.blogspot.com

--~--~---------~--~----~------------~-------~--~----~

3. WebView Text Color

4. Direct access to GEARS geolocation without going through the browser interface

5. Setting Ringer From Resource?

6. How to make a Draggable Menu

7. What is the problem with my android: Unable to extract+optimize DEX from '/system/framework/ext.jar'