Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.johngjackson.statcalcbeta1;
- import android.content.Context;
- import android.text.Editable;
- import android.text.TextWatcher;
- import android.widget.EditText;
- import android.widget.LinearLayout;
- /**
- * Created by johny on 10/31/2016.
- */
- final class List {
- private int identificationNumber;
- private LinearLayout holder;
- List (int identificationNumber, LinearLayout l){
- this.identificationNumber = identificationNumber;
- this.holder = l;
- addNewEdit();
- }
- private void addNewEdit() {
- final EditText newEditText = new EditText(this);
- holder.addView(newEditText);
- newEditText.addTextChangedListener(new TextWatcher() {
- @Override
- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
- }
- @Override
- public void onTextChanged(CharSequence s, int start, int before, int count) {
- }
- @Override
- public void afterTextChanged(Editable s) {
- addNewEdit();
- newEditText.removeTextChangedListener(this);
- }
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment