Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - prevent application from destroying on back button press

prevent application from destroying on back button press

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

prevent application from destroying on back button press

Postby jjaaxx44 » Wed Feb 25, 2009 6:43 am

hey frends,
i am designing a game using single view.
when i press back button due to life cycle of android ie onPause()->onStop()->onDestroy();
my application exits.
i want it to go back on previous screen or to open menu, so is der any way...?? :(
thanx in advance
jjaaxx44
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Jan 31, 2009 4:44 am

Top

Postby timhoeck » Wed Feb 25, 2009 7:12 am

You can use dispatchKeyEvent to override keys like the Back button:

Code: Select all
public boolean dispatchKeyEvent(KeyEvent event) {
       if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
          switch (event.getAction()) {
          case KeyEvent.ACTION_DOWN:
             Log.i(TAG, "Back was pressed");
             break;
          case KeyEvent.ACTION_UP:
             Log.i(TAG, "Back key was released");
             break;
          }
       }
       return true;
    }
timhoeck
Junior Developer
Junior Developer
 
Posts: 22
Joined: Fri Jan 16, 2009 4:41 pm

Postby jjaaxx44 » Wed Feb 25, 2009 7:52 am

thanks dude....its working fine.....jst hace 2 change my logic a bit....
thanx v.much
jjaaxx44
Junior Developer
Junior Developer
 
Posts: 10
Joined: Sat Jan 31, 2009 4:44 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 19 guests