Last active
April 28, 2019 08:33
-
-
Save RafalManka/8efadc8359138179df89be362d81ad31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.navigationplayground | |
import android.app.Activity | |
import android.app.Application | |
import android.content.Intent | |
import android.os.Bundle | |
import com.example.user.SelectUserActivity | |
import com.example.navigation.Navigation | |
import com.example.contact.ContactFormModule | |
class App : Application(), Navigation { | |
override fun onCreate() { | |
super.onCreate() | |
ContactFormModule.navigation = this | |
} | |
override fun start(senderActivity: Activity, screenId: String, extras: Bundle?, requestCode: Int?) { | |
val intent = when (screenId) { | |
ContactFormModule.GoTo.selectUser -> Intent(senderActivity, SelectUserActivity::class.java) | |
else -> return | |
} | |
extras?.let { intent.putExtras(it) } | |
when { | |
requestCode != null -> senderActivity.startActivityForResult(intent, requestCode) | |
else -> senderActivity.startActivity(intent) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment