org.hermit.android.core
Class MainActivity.ActivityListener

java.lang.Object
  extended by org.hermit.android.core.MainActivity.ActivityListener
Enclosing class:
MainActivity

public abstract static class MainActivity.ActivityListener
extends java.lang.Object

This interface defines a listener for sub-activity results.


Constructor Summary
MainActivity.ActivityListener()
           
 
Method Summary
 void onActivityCanceled(Intent data)
          Called when an activity you launched exits with a result code of RESULT_CANCELED.
 void onActivityFinished(int resultCode, Intent data)
          Called when an activity you launched exits.
 void onActivityResult(int resultCode, Intent data)
          Called when an activity you launched exits with a result code other than RESULT_CANCELED, giving you the resultCode it returned, and any additional data from it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainActivity.ActivityListener

public MainActivity.ActivityListener()
Method Detail

onActivityFinished

public void onActivityFinished(int resultCode,
                               Intent data)
Called when an activity you launched exits.

Applications can override this to be informed when an activity finishes, either by an error, the user pressing "back", or normally, or whatever. The default implementation calls either onActivityCanceled(), if resultCode == RESULT_CANCELED, or else onActivityResult().

Parameters:
resultCode - The integer result code returned by the child activity through its setResult().
data - Additional data returned by the activity.

onActivityCanceled

public void onActivityCanceled(Intent data)
Called when an activity you launched exits with a result code of RESULT_CANCELED. This will happen if the user presses "back", or if the activity returned that code explicitly, didn't return any result, or crashed during its operation.

Applications can override this if they want to be separately notified of a RESULT_CANCELED. It doesn't make sense to override both onActivityFinished() and this method.

Parameters:
data - Additional data returned by the activity.

onActivityResult

public void onActivityResult(int resultCode,
                             Intent data)
Called when an activity you launched exits with a result code other than RESULT_CANCELED, giving you the resultCode it returned, and any additional data from it.

Applications can override this if they want to be separately notified of a normal exit. It doesn't make sense to override both onActivityFinished() and this method.

Parameters:
resultCode - The integer result code returned by the child activity through its setResult().
data - Additional data returned by the activity.