Fix recycling in ProfileManagerActivity

This commit is contained in:
Mygod
2015-11-30 09:45:31 +08:00
parent 2127e17cc7
commit b11280479b
@@ -78,6 +78,9 @@ class ProfileManagerActivity extends AppCompatActivity with OnMenuItemClickListe
if (item.id == ShadowsocksApplication.profileId) {
text.setChecked(true)
selectedItem = this
} else {
text.setChecked(false)
if (selectedItem eq this) selectedItem = null
}
}
@@ -169,9 +172,8 @@ class ProfileManagerActivity extends AppCompatActivity with OnMenuItemClickListe
attachService(new IShadowsocksServiceCallback.Stub {
def stateChanged(state: Int, msg: String) = () // ignore
def trafficUpdated(txRate: String, rxRate: String, txTotal: String, rxTotal: String) {
def trafficUpdated(txRate: String, rxRate: String, txTotal: String, rxTotal: String) =
if (selectedItem != null) selectedItem.updateText(true)
}
})
}