On button click, I am trying to trigger the intent call, it takes place almost 2 to 3 mins. So, I am showing a progress bar on the screen.
activityBinding.btnDeviceStatus.setOnClickListener {
activityBinding.progressBlock.visibility = View.VISIBLE
Thread(Runnable {
try {
startActivityForResult(configIntent, intentRequest)
} catch (e: InterruptedException) {
e.printStackTrace()
runOnUiThread {
activityBinding.pairLogs.visibility = View.VISIBLE
activityBinding.pairLogs.text = DeviceStatus.NotAvailable.toString()
activityBinding.buttnRow.visibility = View.VISIBLE
activityBinding.progressBlock.visibility = View.GONE
}
}
}).start()
}
Facing a few issues as below
The progress bar is visible but the screen has been frozen some times after that only the progress bar started rotating.
Even though I called the intent inside the separate thread, I am facing an ARN issue.