Guest User

Untitled

a guest
Feb 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. TextView myText;
  2. String appName;
  3. String helloWord;
  4. String txt;
  5. myText = findViewById (R.id.mytext);
  6. appName = getResources().getString(R.string.app_name);
  7. helloWord = getResources().getString(R.string.helloWord);
  8. txt = myText.getText().toString();
  9. public void changeText(View v){
  10. if (txt.equals(helloWord)){
  11. myText.setText(appName);
  12. }else if(txt.equals(appName)){
  13. myText.setText(helloWord);
  14. }
  15. }
  16.  
  17. public void changeText(View v){
  18. txt = myText.getText().toString();
  19. if (txt.equals(helloWord)){
  20. myText.setText(appName);
  21. }else if(txt.equals(appName)){
  22. myText.setText(helloWord);
  23. }
  24. }
Add Comment
Please, Sign In to add comment