Commit f4fecbfd authored by Mygod's avatar Mygod Committed by Max Lv

Fix crash

parent 7f1179f8
...@@ -86,12 +86,10 @@ class MainPreferenceFragment : LeanbackPreferenceFragment(), ShadowsocksConnecti ...@@ -86,12 +86,10 @@ class MainPreferenceFragment : LeanbackPreferenceFragment(), ShadowsocksConnecti
object : IShadowsocksServiceCallback.Stub() { object : IShadowsocksServiceCallback.Stub() {
override fun stateChanged(state: Int, profileName: String?, msg: String?) = changeState(state, msg) override fun stateChanged(state: Int, profileName: String?, msg: String?) = changeState(state, msg)
override fun trafficUpdated(profileId: Long, txRate: Long, rxRate: Long, txTotal: Long, rxTotal: Long) { override fun trafficUpdated(profileId: Long, txRate: Long, rxRate: Long, txTotal: Long, rxTotal: Long) {
Core.handler.post { stats.summary = getString(R.string.stat_summary,
stats.summary = getString(R.string.stat_summary, getString(R.string.speed, Formatter.formatFileSize(activity, txRate)),
getString(R.string.speed, Formatter.formatFileSize(activity, txRate)), getString(R.string.speed, Formatter.formatFileSize(activity, rxRate)),
getString(R.string.speed, Formatter.formatFileSize(activity, rxRate)), Formatter.formatFileSize(activity, txTotal), Formatter.formatFileSize(activity, rxTotal))
Formatter.formatFileSize(activity, txTotal), Formatter.formatFileSize(activity, rxTotal))
}
} }
override fun trafficPersisted(profileId: Long) { } override fun trafficPersisted(profileId: Long) { }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment