File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import cloud.mindbox.mobile_sdk.managers.DbManager
2727import cloud.mindbox.mobile_sdk.models.Configuration
2828import cloud.mindbox.mobile_sdk.models.getShortUserAgent
2929import cloud.mindbox.mobile_sdk.repository.MindboxPreferences
30+ import cloud.mindbox.mobile_sdk.safeAs
3031import cloud.mindbox.mobile_sdk.utils.Constants
3132import cloud.mindbox.mobile_sdk.utils.Stopwatch
3233import com.android.volley.Request
@@ -216,12 +217,11 @@ internal class WebViewInAppViewHolder(
216217 requestQueue.add(stringRequest)
217218 }
218219 }
219- webView.get()?.let { webView ->
220- // Remove the old webview if it not hidden on previous activity
221- if (webView.isAttachedToWindow) {
222- (webView.parent as ViewGroup ).removeView(webView )
220+ webView.get()?.let { view ->
221+ if (view.parent != = inAppLayout) {
222+ view.parent.safeAs< ViewGroup >()?.removeView(view)
223+ inAppLayout.addView(view )
223224 }
224- inAppLayout.addView(webView)
225225 } ? : onDestroy()
226226 }
227227
You can’t perform that action at this time.
0 commit comments