views:

43

answers:

2

Hi,on Android, i need an EditText with a fixed Suffix (A String i want to add to the text).Now i'm using a TextWatcher to catch the onTextChanged Event, but if i change the Text again adding my suffix, it goes on StackOverflow caused by an infinite recursion.

Sorry if is not sounds clear, but i'm a java novice and i have a bad english.

A: 

I assume you're having a stack overflow because when you programmatically add the suffix, it triggers an onTextChanged event.

Have you thought about setting a flag right before you set it programmatically so the next time it's called you can know not to add the suffix?

The alternative is to only add the suffix after the user submits your form.

Brandon
well, what a shame, i did not think abouk it and was so simple.Tnx (coming from qt4 i was wondering if there was any kind of setSuffix())
Martino