Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@JoaquimLey
Last active September 24, 2017 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoaquimLey/54623c1283b4ee12416859d92b4edb78 to your computer and use it in GitHub Desktop.
Save JoaquimLey/54623c1283b4ee12416859d92b4edb78 to your computer and use it in GitHub Desktop.
public abstract class BasePresenter<V> {
protected V mView;
public final void attachView(@NonNull V view) {
mView = view;
}
public final void detachView() {
mView = null;
}
/**
* Check if the view is attached.
* This checking is only necessary when returning from an asynchronous call
*/
protected final boolean isViewAttached() {
return mView != null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment