The way you have written it that is what should happen -- you have a loop and you keep replacing the text with the substring. Generally in Jave setXXX methods will replace the current value of a property with the new value. Since this looks like homework check the docs for a method that will add to the string you currently have.
On Feb 18, 7:45 am, mohit verma <[email protected]> wrote: > Hi guys, > I am having a string containing some words. > Now in a for loop , i traverse the string and according to some condition i > set the color and try to display text in this way: > > while(not reached string length) > { > > if(condition1) my_edittext.setColor(Color.RED); > > else if(condition2) my_edittext.setColor(Color.BLUE); > > and so on..... > > } > > my_edittext.setText(substring); > > } > > Guys, i want my edittext to be filled-up by this colorfull string on > activity startup(I mean without any actions yet performed on UI). > > When i do all this..... in some string test cases , last word of my string > appears in edittext but in other cases ... no string at all. > > Could someone please help me correct my way of implementation? > > Thanks in advance > > -- > Mohit -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

