Skip to content

Commit cf0b296

Browse files
authored
Merge branch 'master' into opt/all_transaction
2 parents a9ba250 + 602c086 commit cf0b296

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

app/src/main/java/one/mixin/android/ui/home/ConversationListFragment.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,14 @@ class ConversationListFragment : LinkFragment() {
177177
private var enterJob: Job? = null
178178

179179
companion object {
180-
fun newInstance() = ConversationListFragment()
180+
@Volatile
181+
private var INSTANCE: ConversationListFragment? = null
182+
183+
fun getInstance(): ConversationListFragment {
184+
return INSTANCE ?: synchronized(this) {
185+
INSTANCE ?: ConversationListFragment().also { INSTANCE = it }
186+
}
187+
}
181188

182189
const val TAG = "ConversationListFragment"
183190

app/src/main/java/one/mixin/android/ui/home/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ class MainActivity : BlazeBaseActivity() {
983983
}
984984

985985
private val conversationListFragment by lazy {
986-
ConversationListFragment()
986+
ConversationListFragment.getInstance()
987987
}
988988

989989
private val walletFragment by lazy {

0 commit comments

Comments
 (0)