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

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 - returning from an Activity

returning from an Activity

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

returning from an Activity

Postby jbrohan » Fri Oct 02, 2009 5:38 pm

Hello
I found a good example of a camera (Thanks Erado). It has a small Class which extends Activity and the main business is in class PreviewView extends SurfaceView implements SurfaceHolder.Callback, AutoFocusCallback {
etc etc}

In the original example the his Activity is the main. However I would prefer to implement it as an activity called by an Intent, and returning to the onActivityResult in my main Activity.

In other cases I've used this.finish(); to return from an activity started for result. I cannot figure out how to exit this class. It goes round and round nicely taking and storing photos for every click, but I want it to stop after one and return to the main caller to decide what to do next.

Thanks
John
jbrohan
Junior Developer
Junior Developer
 
Posts: 14
Joined: Fri Aug 28, 2009 11:12 am
Location: Montreal

Top

Postby nmc » Fri Oct 02, 2009 6:33 pm

In order to return to the caller of your activity (and return some values to it), you would do something like this:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.         Intent i = new Intent();
  3.  
  4.         i.putExtra("SomeName", SomeValue); // e.g. filename of photo?
  5.  
  6.         setResult(RESULT_OK, i);
  7.  
  8.         finish();
  9.  
  10.  
Parsed in 0.012 seconds, using GeSHi 1.0.8.4
nmc
Senior Developer
Senior Developer
 
Posts: 154
Joined: Thu Nov 27, 2008 8:30 pm
Location: Germany

Postby Sowmya » Mon Oct 05, 2009 8:40 am

Sowmya
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Fri Mar 06, 2009 7:49 am

Top

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: Exabot [Bot] and 7 guests