Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
//View interface
interface MainView : MvpView {
fun printLog(msg: String)
//View implementation
class MainActivity : MvpAppCompatActivity(), MainView {
internal lateinit var presenter: MainPresenter
override fun onCreate(savedInstanceState: Bundle?) {
override fun printLog(msg: String) {
Log.e(TAG, "$msg activity hash code ${hashCode()}")
companion object {
const val TAG = "MoxyDebug"
//Presenter implementation
class MainPresenter : MvpPresenter<MainView>() {
override fun onFirstViewAttach() {
Log.e("TAG", "presenter hash code : ${hashCode()}")
E: presenter hash code: 147558861
E: TEST activity hash code: 196819896
//rotate screen
E: TEST activity hash code: 20903448
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.