org.appcelerator.titanium.util
Interface TiActivitySupport


public interface TiActivitySupport

This interface is designed to launch an activity for which you would like a result when it finishes. For example, you may want to start an activity that lets the user pick a person from his contacts. When it ends, it returns the number that was selected. You can launch the activity by calling launchActivityForResult(Intent, int, TiActivityResultHandler). The result will come back through TiActivityResultHandler.onResult(android.app.Activity, int, int, Intent) method.


Method Summary
 int getUniqueResultCode()
           
 void launchActivityForResult(Intent intent, int code, TiActivityResultHandler handler)
          Launches an activity for which you would like a result when it finishes.
 

Method Detail

launchActivityForResult

void launchActivityForResult(Intent intent,
                             int code,
                             TiActivityResultHandler handler)
Launches an activity for which you would like a result when it finishes. When this activity exits, TiActivityResultHandler.onResult(android.app.Activity, int, int, Intent) method will be invoked.

Parameters:
intent - the passed in intent.
code - the request code, a code that represents the launched activity. This code will be returned in TiActivityResultHandler.onResult(android.app.Activity, int, int, Intent) when the activity exits.
handler - the callback handler.

getUniqueResultCode

int getUniqueResultCode()
Returns:
a code that represents the launched activity. This must be unique to differentiate launched activities that use the same callback handler.


Copyright © 2010-2012 Appcelerator, Inc. Licensed under the Apache License 2.0