mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-05-19 20:29:00 -04:00
refactor(messages): persist contact variables
This commit is contained in:
@@ -233,6 +233,12 @@ class MessagesFragment : Fragment(), Logging {
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onSaveInstanceState(outState: Bundle) {
|
||||
super.onSaveInstanceState(outState)
|
||||
outState.putString("contactKey", contactKey)
|
||||
outState.putString("contactName", contactName)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
@@ -243,6 +249,11 @@ class MessagesFragment : Fragment(), Logging {
|
||||
model.setContactKey(contactKey)
|
||||
binding.messageTitle.text = contactName
|
||||
}
|
||||
if (savedInstanceState != null) {
|
||||
contactKey = savedInstanceState.getString("contactKey").toString()
|
||||
contactName = savedInstanceState.getString("contactName").toString()
|
||||
binding.messageTitle.text = contactName
|
||||
}
|
||||
|
||||
binding.sendButton.setOnClickListener {
|
||||
debug("User clicked sendButton")
|
||||
|
||||
Reference in New Issue
Block a user