How do I finish an Activity from within a Presenter or a View in the mortar sample app?
How do I finish an Activity from within a mortar Presenter or a View?
805 views Asked by Wu-Man At
1
There are 1 answers
Related Questions in DAGGER
- Late init / dynamic dependency initialisation in Dagger
- Dagger cycle dependency issue for ViewModelFactory and AndroidInjection
- How do I supply an object to a parent constructor when that object is normally is dependency injected?
- @AssistedInject in ViewModel using Dagger (NOT Hilt, just dagger) does not compile: cannot be provided without an @Inject constructor
- Using Hilt but the base project is using Dagger
- Dagger Hilt Error Execution failed for task How can I solve this issue?
- Error when UI Testing Android Apps using Jetpack Compose, dagger hilt and JUnit4
- After upgrading to gradle 8, dagger doesn't work properly
- ComponentProcessingStep was unable to process 'MyApplication_HiltComponents.SingletonC' because MyClass could not be resolved
- Can constructor dependencies be dynamically injected, in Kotlin, without runtime reflection?
- error: [Dagger/MissingBinding]. Cannot be provided without an @Provides-annotated method
- Modern solution to inject dependencies in Service with Dagger
- Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.hiltapp.Hilt_HiltApplication" on path: DexPathList
- Application maintaining cache even after uninstall
- Get provides from another scope
Related Questions in MORTAR
- Android - How works MortarScope?
- Dagger Android View Injection Error
- How do I prevent Mortar scopes from persisting across screens?
- Sub containers in Flow
- What is the prefered way to save/restore screen state with Flow + Mortar + Dagger2?
- Mortar and Flow libraries vs. ViewPager
- Getting Started w/ Flow and Mortar
- How do I pass reference to Activity for ActionBarDrawerToggle?
- Mortar / Flow save view and presenter in backstack
- Dagger2 in Eclipse not generating classes
- Mortar: How-to use Presenter for List Item/Adapter
- Can Flow and Mortar load a screen in the background if it is slow to load (e.g. GoogleMap)?
- Mortar / Flow samples NoClassDefFoundError: com.example.mortar.MortarDemoApplication$1
- Using Flow & Mortar with ViewPager
- What is scope of class annotated with @Singleton in Mortar
Related Questions in SQUARE-FLOW
- Proper way to use Dispatcher in Flow?
- How to switch layouts back and forth using Square's flow library?
- Sub containers in Flow
- Mortar and Flow libraries vs. ViewPager
- How to work with view subcontainers in Flow
- Mortar / Flow save view and presenter in backstack
- Can Flow and Mortar load a screen in the background if it is slow to load (e.g. GoogleMap)?
- Using Flow & Mortar with ViewPager
- Recommended way to get Activity inside Mortar screen?
- Writing Tests for Flow and Mortar Apps
- What was the reason to put view classes to layout instead of inflating layout inside view class?
- Equivalent of onActivityResult for Mortar and Flow?
- Flow sample SimpleSwitcher subcontainers
- How to @Provide an Activity for the MortarActivityScope, without leaking the Activity on orientation changes?
- Building Square's "Flow" sample app: Maven success but unusable APK
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
The majority of the time you would want to avoid doing this. But in dire circumstances you could follow the same pattern the ActionBarOwner[0] class implements. Create an injectable class that exposes Activity#finish via an interface.
Item 3 in [1] is related but the calling order is inverted. (Activity lifecycle methods to presenters instead of Presenters to Activity methods).
Hope that helps!
[0] https://github.com/square/mortar/blob/master/mortar-sample/src/main/java/com/example/mortar/android/ActionBarOwner.java
[1] Mortar + Flow with third party libraries hooked to activity lifecycle