If File.Exists(File.DirInternal, "test.html") = False Then
Log("File test.html does not exist in DirInternal. Attempting to copy from Assets.")
Try
File.Copy(File.DirAssets,"test.html",File.DirInternal,"test.html")
Log("File copied successfully.")
Catch
Log("Error copying file: " & LastException.Message)
End Try
Else
Log("File test.html already exists in DirInternal.")
End If
If File.Exists(File.DirInternal, "test.html") Then
Log("Loading URL: file://" & File.DirInternal & "/test.html")
WebView1.LoadUrl("file://" & File.DirInternal & "/test.html")
Else
Log("Failed to load WebView. File test.html not found even after copy attempt.")
ToastMessageShow("Error: HTML file not found.", True)
End If
' به جای استفاده از File.DirInternal، مستقیماً از پوشه Assets استفاده کنید:
'WebView1.LoadUrl("file:///android_asset/test.html")
WebView1.LoadUrl("file://" & File.DirInternal & "/test.html")
وقتی میخوام فایل html رو تو webview نشون بدم فایل تو موبایل هست دسترسی هم داره اما وبویو با دستور زیر مواجه میشه
net:ERR_ACCESS_DENIED
هر راهی رو امتحان کردم درست نمیشه لطفا اگه کسی بلده کمک کنه میخوام فایل html رئ باهاش باز کنم