Timber duplicate logs after calling finish() and restarting app

前端 未结 2 1995
误落风尘
误落风尘 2021-01-20 17:40

I have an onTouchListener on my TextView. On touch, I log with Timber.i() and then I call finish(). If after finish(), I launch my

2条回答
  •  再見小時候
    2021-01-20 18:14

    I surely am very late but still posting it. @cwbowron has explained it very well.
    This trick got it fixed for me:

    class TimberLogImplementation {
    companion object {
        fun initLogging() {
            if(Timber.treeCount() != 0) return
            if (BuildConfig.DEBUG) Timber.plant(DebugTree())
            else Timber.plant(ReleaseTree())
            }
        }
    }
    

提交回复
热议问题