skip to Main Content

Android Studio – How to create an instance of smsManager in kotlin with the given context of an activity?

private fun getSmsManagerForSubscriptionId(context: Context, subsId: Int): SmsManager { val smsManager = if (Build.VERSION.SDK_INT >= M) { context.getSystemService(SmsManager::class.java) as SmsManager } else { TODO("VERSION.SDK_INT < M") } val smsManagerInstanceForSubsId = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { smsManager.createForSubscriptionId(subsId) } else { TODO("VERSION.SDK_INT <…

VIEW QUESTION
Back To Top
Search