0

I've a query regarding performance issue.

I've 6 EditTexts in a fragment. On each EditText I've added a textWatcher. Inside every afterTextChanged() method I'm sending all the 6 values to the activity through interface. So, practically all 6 values are updated on each letter written in any of the text field. Suppose, if I've total 200 letters in all text fields then the void method of interface will be called 200 times. My question is, will this effect the performance even in lower speced devices ? Or it wouldn't bother so much. Please experts help me. (Code will be provided if needed).

noob-Sci-Bot
  • 231
  • 5
  • 18
  • 200 times? why 200? it will be called once, not 200 times – pskink Jul 30 '17 at 12:37
  • But i've checked with Toast. If I write - " hello" the afterTextChanged() is called upon 5 times. Toast message shows - h, he, hel, hell, hello. So should my updata() interface method. – noob-Sci-Bot Jul 30 '17 at 12:43
  • ah. ok if you are typing 200 letters, then yes it will be called 200 times, i thought you already have 200 letters and you type another one – pskink Jul 30 '17 at 12:49
  • why do you need to update all the 6 EditTexts even if the user types in one? – Bob Jul 30 '17 at 13:03
  • Should this effect the app performance? @pskink – noob-Sci-Bot Jul 30 '17 at 18:44
  • @Bob I'm calling the same interface method for any editText's text change which contains 6 parameters, That's why. Should I use 6 different methods for 6 text fields ? Plz guide me. – noob-Sci-Bot Jul 30 '17 at 18:45
  • You can have the interface method which has one additional parameter unique id to identify the EditText. – Bob Jul 30 '17 at 18:52
  • Thank you for your suggestion. This seems more logical. – noob-Sci-Bot Jul 31 '17 at 05:51

0 Answers0