Guest User

Untitled

a guest
Oct 31st, 2016
617
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. package com.johngjackson.statcalcbeta1;
  2.  
  3. import android.content.Context;
  4. import android.text.Editable;
  5. import android.text.TextWatcher;
  6. import android.widget.EditText;
  7. import android.widget.LinearLayout;
  8.  
  9. /**
  10. * Created by johny on 10/31/2016.
  11. */
  12.  
  13. final class List {
  14. private int identificationNumber;
  15. private LinearLayout holder;
  16.  
  17.  
  18. List (int identificationNumber, LinearLayout l){
  19. this.identificationNumber = identificationNumber;
  20. this.holder = l;
  21.  
  22. addNewEdit();
  23. }
  24.  
  25. private void addNewEdit() {
  26. final EditText newEditText = new EditText(this);
  27.  
  28. holder.addView(newEditText);
  29.  
  30. newEditText.addTextChangedListener(new TextWatcher() {
  31. @Override
  32. public void beforeTextChanged(CharSequence s, int start, int count, int after) {
  33. }
  34.  
  35. @Override
  36. public void onTextChanged(CharSequence s, int start, int before, int count) {
  37. }
  38.  
  39. @Override
  40. public void afterTextChanged(Editable s) {
  41. addNewEdit();
  42. newEditText.removeTextChangedListener(this);
  43. }
  44. });
  45.  
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment