Guest User

Untitled

a guest
Mar 20th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. package com.example.dns.translateapp;
  2.  
  3. import android.support.v7.app.AppCompatActivity;
  4. import android.os.Bundle;
  5. import android.text.Editable;
  6. import android.text.TextWatcher;
  7. import android.view.View;
  8. import android.widget.EditText;
  9. import android.widget.TextView;
  10.  
  11. import org.w3c.dom.Text;
  12.  
  13. public class TestActivity extends AppCompatActivity {
  14.  
  15. EditText et;
  16. TextView tv;
  17. TextView txt;
  18. GoGoGo gg;
  19. @Override
  20. protected void onCreate(Bundle savedInstanceState) {
  21. super.onCreate(savedInstanceState);
  22. setContentView(R.layout.activity_test);
  23. et = (EditText)findViewById(R.id.textEditor);
  24. tv = (TextView)findViewById(R.id.getWordPlease);
  25. txt = (TextView)findViewById(R.id.checkThread);
  26. et.addTextChangedListener(new TextWatcher() {
  27. @Override
  28. public void beforeTextChanged(CharSequence s, int start, int count, int after) {
  29.  
  30. }
  31.  
  32. @Override
  33. public void onTextChanged(CharSequence s, int start, int before, int count) {
  34. tv.setText(s);
  35. }
  36.  
  37. @Override
  38. public void afterTextChanged(Editable s) {
  39.  
  40. }
  41. });
  42.  
  43.  
  44. }
  45.  
  46.  
  47.  
  48. public void pushButt(View view) {
  49. gg = new GoGoGo();
  50. txt.setText(Integer.toString(gg.a));//уже лучше
  51. gg.start();
  52.  
  53. }
  54. }
Add Comment
Please, Sign In to add comment