Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 13th, 2012  |  syntax: None  |  size: 0.42 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Android listen for all events in application
  2. public class TopActivity extends Activity {
  3.  
  4. }
  5.  
  6.  
  7. public class screen1 extends TopActivity {
  8.  
  9. }
  10.        
  11. public class TopActivity extends Activity implements OnClickListener,
  12.   OnTouchListener, OnKeyListener, OnLongClickListener /*etc*/ {
  13.  
  14.   public void onClick() {
  15.     doSomething();
  16.   }
  17.  
  18.   public boolean onKey(View v, int keyCode, KeyEvent event) {
  19.     doSomething();
  20.   }
  21.  
  22.   // etc
  23. }