daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. userInput.setOnKeyListener(new OnKeyListener(){
  2.         @Override
  3.         public boolean onKey(View v, int keyCode, KeyEvent event) {
  4.             if (event.getAction() == KeyEvent.ACTION_DOWN) {
  5.                 lastInput = (char)event.getUnicodeChar();
  6.                 return false;
  7.             }
  8.             return true;
  9.         }
  10.     });
  11.    
  12. enterLetterButton.setOnClickListener(new OnClickListener(){
  13.         public void onClick(View arg0) {
  14.  
  15.             guess(lastInput);
  16.  
  17.         }
  18.     });
  19.    
  20. public void guess(char guess) {
  21.  
  22.     if (text.toString().indexOf(lastInput) != -1) {
  23.         text.setSpan(new ForegroundColorSpan(Color.BLACK), 0, text.length(), 0);
  24.     }
  25.     // if all-show gameEnd();
  26.     else {
  27.         showImages();
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top