Mobile Browser Widget Crashes

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
JereMiami
Posts: 119
Joined: Mon Nov 03, 2014 12:17 am

Mobile Browser Widget Crashes

Post by JereMiami » Tue Dec 22, 2020 1:22 am

This is for android.

I have a pdf file called sample.pdf saved in specialFolderPath("documents"). I want to display it in the app. I suppose I have to use the browser widget.

But, when I script:

set the url of widget "browser" to specialFolderPath("documents") & "/sample.pdf"

-or-

set the url of widget "browser" to specialFolderPath("documents") & "sample.pdf"

Either way (forward slash or not) it crashes the app. Is that how I am supposed to do it? Any other way to display it?

Thanks!

Bernard
Posts: 351
Joined: Sat Apr 08, 2006 10:14 pm
Location: London, England

Re: Mobile Browser Widget Crashes

Post by Bernard » Tue Dec 22, 2020 2:23 am

a) Does your PDF display in the browser widget if you run the code in the IDE?

b) try

Code: Select all

launch url "file:" & specialFolderPath("documents") & "/sample.pdf"
In the IDE this will at least test that there's nothing wrong with your path/filename or the PDF itself in relation to the widget. You could then try using "launch url" as above in the stack on Android.

Hopefully this can narrow down where the problem lies.

JereMiami
Posts: 119
Joined: Mon Nov 03, 2014 12:17 am

Re: Mobile Browser Widget Crashes

Post by JereMiami » Tue Dec 22, 2020 9:24 pm

It worked! Can't thank you enough.

Post Reply

Return to “Talking LiveCode”