Questions tagged [android-mvp]

On Android, MVP is a way to separate background tasks from activities/views/fragments to make them independent of most lifecycle-related events. This way an application becomes simpler and code maintainability becomes better. Use this tag if your question is specifically about using MVP in Android.

On Android, MVP is a way to separate background tasks from activities/views/fragments to make them independent of most lifecycle-related events. This way an application becomes simpler and code maintainability becomes better. Use this tag if your question is specifically about using MVP in Android.

The tag should be used along with

278 questions
3
votes
1 answer

Injecting RecyclerView.Adapter using Dagger

I'm trying to inject a RecyclerView adapter into an Activity, but i'm not getting the result I'm expecting. The list is not being filled. This is my adapter implementation: public class ListAdapter extends…
3
votes
2 answers

Multiple fragment in one Activity in Android MVP

I was working with Android MVP architecture and I am following Google MVP Architecture. I am facing issue when Activity have multiple fragment,In my case activity having 2 tab. I am not able to understand, Should i create two Presenter for every…
Ankit Saini
  • 374
  • 5
  • 15
3
votes
1 answer

correct work with onActivityResult in MVP project

I try use MVP in my project and I get some question. For example I have MyPresenter presenter; MyFragment view; In view I have button with name "open barcode scan" witch is open barcode scan activity like…
ip696
  • 6,574
  • 12
  • 65
  • 128
3
votes
3 answers

Architecture for making Network Calls and parsing the JSON response

I am working on a new Android Application and I would like to organise all the components - Network Call class, JSON parsing class etc. properly. I am using Okhttp for network calls; After a lot of research I was able to structure my code like…
localhost
  • 107
  • 1
  • 11
3
votes
0 answers

Moxy inject UseCase into Presenter

How can I inject UseCase into Moxy Presenter? @InjectViewState class LoginPresenter @Inject constructor() : BasePresenter() { @Inject lateinit var facebookLoginBehavior: FlowBehavior @Inject…
Pasha Shkaran
  • 1,433
  • 2
  • 23
  • 41
3
votes
1 answer

MVP in Android - where to place Google API calls for location services?

I am developing my first android app and since my code is quickly becoming a huge mess I decided to follow the MVP pattern. My app is divided in Views (Fragments), Presenters, and Contracts (interfaces with the methods a view and it's presenter will…
3
votes
1 answer

Android MVP - Detaching view (onPause VS onDestroy) and state preservation

I'm trying to implement the MVP architecture in my app. However, after reading some blogs and viewing some sample project samples, I'm not sure I completely understood where is the right place to detach the view, and what should be done once the…
dor506
  • 5,246
  • 9
  • 44
  • 79
3
votes
0 answers

Best way to pass a presenter for a parent views

I am writing multiple layer MVP based application. Common methods for all layers goes to a BASE layer. Then specific methods for each child classes goes to MIDDLE and TOP layers. From a code example you can see that i am passing my view for a…
Zhh
  • 31
  • 3
3
votes
4 answers

Cannot access Nullable Dagger2 Android

I am writing an app where I am using Dagger2 for dependency Injection. I am new to dagger. I am getting confused on how it works and I am not able to figure it out how to use this library. I have tried writing below modules and components with the…
nithesh1990
  • 51
  • 1
  • 6
3
votes
1 answer

android MVP - Presenter with multiple model's

Planning on implementing MVP architecture for a MVC type android app. I have a concern on how I can make a presenter that will have multiple models. Typically a presenter's constructor will look like this: MyPresenter(IView view, IInteractor…
j2emanue
  • 60,549
  • 65
  • 286
  • 456
2
votes
1 answer

Should Presenter handle all events of View in MVP design architecture in Android?

Suppose I have a Button in my Activity which shows me a Toast message when it is clicked. Now my question is, should I notify the Presenter when my button is clicked and the Presenter should decide what the View should do or it is not required to…
Hadi
  • 544
  • 1
  • 8
  • 28
2
votes
2 answers

How to return error responses from Coroutines

I'm trying to change all my callbacks to coroutines, I have readed about them and they are fasinating ! What I want to accomplish is just login a user, but if the login logic fails, notify it to my presenter. This is what I have…
SNM
  • 5,625
  • 9
  • 28
  • 77
2
votes
1 answer

Should MVP model contain android specific term?

I can do the logical things inside MVP view, but as far as I know, according to MVP pattern, view should be as dumb as possible. Can MVP model contain android specific term? If not, then how can I use activity context inside MVP model?
Newaj
  • 3,992
  • 4
  • 32
  • 50
2
votes
1 answer

MVP with Clean Architecture, where to add thread for network operation

I have been working as an Android Developer since last 4 years. And recently I started to learn MVP with Clean architecture. I am not using any library like Dagger, Retrofit or anything because I want to understand the architecture. I created a…
yogi
  • 309
  • 1
  • 3
  • 13
2
votes
2 answers

Getting Error on Fragment Transaction(Null Object Reference)

I am new to Android Development and I am getting some errors on my code.I am trying to set the Fragment(dashboard,expense,income) that i want for my HomeActivity through the setFragment function.But i want to implement an MVP approach so I created…