-
- All Implemented Interfaces:
public interface ActivityAccessAn interface for accessing activities in a decentralized way, where multiple listeners can listen to event like onPause, onResume, etc, and most importantly, can use prepareOnResult to set up lambdas to occur when a result code is received.
-
-
Method Summary
Modifier and Type Method Description abstract UnitperformBackPress()Performs a back button press on the activity. abstract IntegerprepareOnResult(Integer presetCode, Function2<Integer, Intent, Unit> onResult)Returns a request code for starting an intent where the onResult function will be called upon completion. abstract Single<Set<String>>requestPermissions(Array<String> permission)Requests permissions, but with a callback response. abstract Single<Boolean>requestPermission(String permission)Requests a permission, but with a callback response. abstract ActivitygetActivity()Gets the activity. abstract ContextgetContext()Gets the context. abstract BundlegetSavedInstanceState()Gets the savedInstanceState of the activity. abstract Observable<Unit>getOnResume()Listens to the onResume callback of the activity. abstract Observable<Unit>getOnPause()Listens to the onPause callback of the activity. abstract Observable<Bundle>getOnSaveInstanceState()Listens to the onSaveInstanceState callback of the activity. abstract Observable<Unit>getOnLowMemory()Listens to the onLowMemory callback of the activity. abstract Observable<Unit>getOnDestroy()Listens to the onDestroy callback of the activity. abstract Observable<Triple<Integer, Integer, Intent>>getOnActivityResult()Listens to the onActivityResult callback of the activity. abstract Observable<Intent>getOnNewIntent()Listens to the onNewIntent callback of the activity. -
-
Method Detail
-
performBackPress
abstract Unit performBackPress()
Performs a back button press on the activity.
-
prepareOnResult
abstract Integer prepareOnResult(Integer presetCode, Function2<Integer, Intent, Unit> onResult)
Returns a request code for starting an intent where the onResult function will be called upon completion. Use this instead of overriding Activity.onActivityResult.
-
requestPermissions
abstract Single<Set<String>> requestPermissions(Array<String> permission)
Requests permissions, but with a callback response.
-
requestPermission
abstract Single<Boolean> requestPermission(String permission)
Requests a permission, but with a callback response.
-
getActivity
abstract Activity getActivity()
Gets the activity.
-
getContext
abstract Context getContext()
Gets the context. If you need to preview a view generator using Android Studio, it can be useful to have this separate from Activity.
-
getSavedInstanceState
abstract Bundle getSavedInstanceState()
Gets the savedInstanceState of the activity.
-
getOnResume
abstract Observable<Unit> getOnResume()
Listens to the onResume callback of the activity.
-
getOnPause
abstract Observable<Unit> getOnPause()
Listens to the onPause callback of the activity.
-
getOnSaveInstanceState
abstract Observable<Bundle> getOnSaveInstanceState()
Listens to the onSaveInstanceState callback of the activity.
-
getOnLowMemory
abstract Observable<Unit> getOnLowMemory()
Listens to the onLowMemory callback of the activity.
-
getOnDestroy
abstract Observable<Unit> getOnDestroy()
Listens to the onDestroy callback of the activity.
-
getOnActivityResult
abstract Observable<Triple<Integer, Integer, Intent>> getOnActivityResult()
Listens to the onActivityResult callback of the activity.
-
getOnNewIntent
abstract Observable<Intent> getOnNewIntent()
Listens to the onNewIntent callback of the activity.
-
-
-
-