Schedule relaunch activity
При старте активити из SDK, активити уходит в loop и пытается перезапуститься. Данная проблема возникает при старте любого активити из SDK Тестировал, на устройствах с android 14,12,10, работало корректно только на android 10(Samsung Galaxy S9).
private val launcherNewCard =
registerForActivityResult(MainFormLauncher.Contract, ::handleNewCardPaymentResult)
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
AcquiringSdk.isDebug = true // Включение логгирования
AcquiringSdk.isDeveloperMode = true
startCardsPayment()
}
private fun startCardsPayment(){
val paymentOptions = PaymentOptions().setOptions {
setTerminalParams(getString(R.string.TERMINAL_TBANK_KEY), getString(R.string.PUBLIC_TBANK_KEY))
orderOptions {
orderId = ORDER_ID
amount = Money.ofRubles(10)
recurrentPayment = false
}
}
val startData = MainFormLauncher.StartData(paymentOptions)
launcherNewCard.launch(startData)
}
private fun handleNewCardPaymentResult(result: MainFormLauncher.Result){
when(result) {
MainFormLauncher.Canceled -> Toast.makeText(requireContext(), "Cancelled", Toast.LENGTH_LONG).show()
is MainFormLauncher.Error -> Toast.makeText(requireContext(), "Error", Toast.LENGTH_LONG).show()
is MainFormLauncher.Success -> Toast.makeText(requireContext(), "Success", Toast.LENGTH_LONG).show()
}
}
Вот что пишет в логах
2024-08-06 14:54:55.185 13134-13134 ActivityThread centra.dom I Schedule relaunch activity: ru.tinkoff.acquiring.sdk.redesign.mainform.ui.MainPaymentFormActivity, getCallers=android.app.Activity.recreate:7091 androidx.core.app.ActivityCompat.recreate:666 androidx.appcompat.app.AppCompatDelegateImpl.updateAppConfiguration:2829 androidx.appcompat.app.AppCompatDelegateImpl.applyApplicationSpecificConfig:2561 androidx.appcompat.app.AppCompatDelegateImpl.applyApplicationSpecificConfig:2522
2024-08-06 14:54:55.185 13134-13134 ActivityThread centra.dom D lastDisplayInfo is: DisplayInfo{"Встроенный экран", displayId 0, displayGroupId 0, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS, FLAG_TRUSTED, real 1080 x 2400, largest app 2297 x 2297, smallest app 1080 x 977, appVsyncOff 2000000, presDeadline 13333333, mode 2120.00001, defaultMode 1, modes [{id=1, width=1080, height=2400, fps=60.000004, alternativeRefreshRates=[120.00001], supportedHdrTypes=[2, 3, 4]}, {id=2, width=1080, height=2400, fps=120.00001, alternativeRefreshRates=[60.000004], supportedHdrTypes=[2, 3, 4]}], hdrCapabilities HdrCapabilities{mSupportedHdrTypes=[2, 3, 4], mMaxLuminance=540.0, mMaxAverageLuminance=270.1, mMinLuminance=0.2}, userDisabledHdrTypes [], minimalPostProcessingSupported false, rotation 0, state ON, committedState ON} currentDisplay is: DisplayInfo{"Встроенный экран", displayId 0, displayGroupId 0, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS, FLAG_TRUSTED, real 1080 x 2400, largest app 2297 x 2297, smallest app 1080 x 977, appVsyncOff 2000000, presDeadline 13333333, mode 2120.00001, defaultMode 1, modes [{id=1, width=1080, height=2400, fps=60.000004, alternativeRefreshRates=[120.00001], supportedHdrTypes=[2, 3, 4]}, {id=2, width=1080, height=2400, fps=120.00001, alternativeRefreshRates=[60.000004], supportedHdrTypes=[2, 3, 4]}], hdrCapabilities HdrCapabilities{mSupportedHdrTypes=[2, 3, 4], mMaxLuminance=540.0, mMaxAverageLuminance=270.1, mMinLuminance=0.2}, userDisabledHdrTypes [], minimalPostProcessingSupported false, rotation 0, state ON, committedState ON}