@Singleton public class ActivityRunner extends Object
Constructor and Description |
---|
ActivityRunner(Activity mainActivity,
ActivityResultRestorer restorer,
KeepAlive keepAlive) |
Modifier and Type | Method and Description |
---|---|
void |
onActivityResult(int requestCode,
int resultCode,
Intent data)
Notify registered handler about activity result.
|
void |
startActivity(Intent intent,
int requestCode,
ActivityResultHandler handler)
Launch an activity for which you would like a result when it finished.
|
void |
startActivity(Intent intent,
int requestCode,
ActivityResultHandler handler,
boolean shouldPreserveResult)
Launch an activity for which you would like a result when it finished.
|
@Inject public ActivityRunner(Activity mainActivity, ActivityResultRestorer restorer, KeepAlive keepAlive)
public void startActivity(Intent intent, int requestCode, ActivityResultHandler handler)
intent
- The intent to start.requestCode
- If >= 0, this code will be returned in onActivityResult() when the activity exits.handler
- Handler to be notify about activity result.public void startActivity(Intent intent, int requestCode, ActivityResultHandler handler, boolean shouldPreserveResult)
intent
- The intent to start.requestCode
- If >= 0, this code will be returned in onActivityResult() when the activity exits.handler
- Handler to be notify about activity result.shouldPreserveResult
- whether activity result should be preserved when app gets killed by the systempublic void onActivityResult(int requestCode, int resultCode, Intent data)
requestCode
- The integer request code originally supplied to startActivity().resultCode
- The integer result code returned by the child activity.data
- An Intent, which can return result data to the caller.