- Fixed crash when returning to the previous activity after received call

or message.
- Better handling of proximity sensor and speaker phone.
- Use aorSpinner.tag to store aor of the selected account.
This commit is contained in:
Juha Heinanen
2020-05-04 20:04:54 +03:00
parent b5053e3019
commit a3d138bafe
9 changed files with 91 additions and 119 deletions
@@ -56,6 +56,7 @@ class CallsActivity : AppCompatActivity() {
when (which) {
DialogInterface.BUTTON_POSITIVE, DialogInterface.BUTTON_NEGATIVE -> {
BaresipService.activities.remove("calls,$aor")
MainActivity.activityAor = aor
returnResult()
val i = Intent(this@CallsActivity, MainActivity::class.java)
i.flags = Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP
@@ -98,6 +99,7 @@ class CallsActivity : AppCompatActivity() {
}
DialogInterface.BUTTON_POSITIVE -> {
removeUaHistoryAt(pos)
CallHistory.save()
clAdapter.notifyDataSetChanged()
}
DialogInterface.BUTTON_NEUTRAL -> {
@@ -180,14 +182,12 @@ class CallsActivity : AppCompatActivity() {
}
override fun onPause() {
CallHistory.save()
returnResult()
MainActivity.activityAor = aor
super.onPause()
}
private fun returnResult() {
val i = Intent()
i.putExtra("aor", aor)
setResult(Activity.RESULT_CANCELED, i)
finish()
}