Recent Posts
HTML | 3 sec ago
None | 7 sec ago
Lua | 12 sec ago
C | 20 sec ago
PHP | 24 sec ago
None | 36 sec ago
None | 52 sec ago
HTML | 1 min ago
None | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Anonymous on the 9th of Feb 2010 09:52:24 PM Download | Raw | Embed | Report
  1. public class MainListActivity extends ListActivity{
  2.     @Override
  3.     public boolean onKeyDown(int keyCode, KeyEvent event)  {
  4.         if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.ECLAIR
  5.                 && keyCode == KeyEvent.KEYCODE_BACK
  6.                 && event.getRepeatCount() == 0) {
  7.             // Take care of calling this method on earlier versions of
  8.             // the platform where it doesn't exist.
  9.             onBackPressed();
  10.         }
  11.  
  12.         return super.onKeyDown(keyCode, event);
  13.     }
  14.  
  15.     @Override
  16.     public void onBackPressed() {
  17.         // This will be called either automatically for you on 2.0
  18.         // or later, or by the code above on earlier versions of the
  19.         // platform.
  20.                 finish();
  21.         return;
  22.     }
  23. }
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: