Created
January 17, 2018 21:59
-
-
Save anonymous/57ce7f5d6af61b9122c0ba498e0a4cb9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.cris.zeiterfassungv2; | |
import android.text.Editable; | |
import android.text.TextWatcher; | |
import android.widget.EditText; | |
public class Sum implements TextWatcher { | |
MainActivity ze; | |
public Sum (MainActivity Zeiterfassung) { | |
ze = Zeiterfassung; | |
} | |
@Override | |
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) { | |
} | |
@Override | |
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) | |
{ | |
} | |
@Override | |
public void afterTextChanged(Editable editable) { | |
EditText txt3 = (EditText) ze.lastRow.getChildAt(3); | |
EditText txt4 = (EditText) ze.lastRow.getChildAt(4); | |
EditText txt5 = (EditText) ze.lastRow.getChildAt(5); | |
if(!txt3.getText().toString().equals("") && !txt4.getText().toString().equals("") && txt5.getText().toString().equals("")) | |
{ | |
String n1 = txt3.getText().toString(); | |
int n11 = Integer.parseInt(n1); | |
String n2 = txt4.getText().toString(); | |
int n22 = Integer.parseInt(n2); | |
txt5.setText(String.valueOf(n22 - n11)); | |
} | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment