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 - Starting activity with no "stack"

Starting activity with no "stack"

Put your problem here if it does not fit any of the other categories.

Starting activity with no "stack"

Postby phix » Thu Jun 03, 2010 12:03 am

Not sure if that's the right term, but I'd like to start an activity from a service when shake is detected. It works, but when the new activity is started, I can hit the back button and it takes me to the last screen I was on when the app was last launched. Here's the runnable that starts it:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. private Runnable listenForShake = new Runnable(){
  2.         public void run(){
  3.                 Log.i(TAG, "Runnable executed.");
  4.                 shakeList.setOnShakeListener(new ShakeListener.OnShakeListener(){
  5.                         public void onShake(){
  6.                                 vibe.vibrate(new long[]{0, 100, 100, 50}, -1);
  7.                                 Intent light = new Intent(getApplicationContext(), LightScreen.class);
  8.                                 light.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  9.                                 startActivity(light);
  10.                         }
  11.                 });
  12.         }
  13. };
  14.  
Parsed in 0.013 seconds, using GeSHi 1.0.8.4


I tried a few other Intent flags but they didn't seem to help. How would I go about starting this activity, and when the user hits the "back" button, it returns to the home screen, or whereever they happened to be before this was called?
Posting questions without code is like going to the doctor and saying "it hurts, fix it."
phix
Master Developer
Master Developer
 
Posts: 230
Joined: Mon Mar 15, 2010 10:37 am

Top

Re: Starting activity with no "stack"

Postby phix » Thu Jun 03, 2010 1:37 am

Thanks anarche.. those look promising.
Posting questions without code is like going to the doctor and saying "it hurts, fix it."
phix
Master Developer
Master Developer
 
Posts: 230
Joined: Mon Mar 15, 2010 10:37 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 17 guests