Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. // BaseActivity의 attachBaseContext
  2. override fun attachBaseContext(newBase: Context?) {
  3. super.attachBaseContext(LocaleWrapper.wrap(newBase))
  4. SplitCompat.install(this)
  5. }
  6. // BaseActivity splitInstallManager, splitInstallListener
  7. val splitInstallManager: SplitInstallManager by lazy { SplitInstallManagerFactory.create(this) }
  8. private val splitInstallListener by lazy {
  9. SplitInstallStateUpdatedListener { state ->
  10. when (state.status()) {
  11. SplitInstallSessionStatus.FAILED -> {
  12. hideQandaProgressbar()
  13. }
  14. SplitInstallSessionStatus.INSTALLED -> {
  15. restartApp(this, LoadingActivity::class.java)
  16. }
  17. }
  18. }
  19. }
  20. // BaseActivity onCreate()
  21. splitInstallManager.registerListener(splitInstallListener)
  22. // BaseActivity onDestroy()
  23. splitInstallManager.unregisterListener(splitInstallListener)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement