wintersoldier
07/25/2024, 5:01 PMlaunchUrl
is called, if the file is already present, it displays "Download Pending" indefinitely. The issue is resolved by deleting the existing file from storage, allowing the download to proceed. This problem doesn’t occur with photos and videos. I'm attaching the code for reference.wintersoldier
07/25/2024, 5:01 PMprivate fun openInCustomTab(url: String) {
val customTabsIntentBuilder = CustomTabsIntent.Builder()
customTabsIntentBuilder.setToolbarColor(
ContextCompat.getColor(this, R.color.colorPrimary)
)
customTabsIntentBuilder.setShowTitle(true)
customTabsIntentBuilder.setStartAnimations(
this,
android.R.anim.slide_in_left,
android.R.anim.slide_out_right
)
customTabsIntentBuilder.setExitAnimations(
this,
android.R.anim.slide_in_left,
android.R.anim.slide_out_right
)
val customTabsIntent = customTabsIntentBuilder.build()
customTabsIntent.launchUrl(this, Uri.parse(url))
}
Skaldebane
07/25/2024, 5:04 PMSkaldebane
07/25/2024, 5:04 PM