damonkohler / sl4a

SL4A brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device.
Apache License 2.0
2.44k stars 800 forks source link

webViewShow() needs close and reopen APIs #196

Open damonkohler opened 9 years ago

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28


I'm using Perl and webViewShow, is there a way to switch html pages by 
re-issuing another webViewShow?

I've been able to use waitForEvent, receiveEvent and postEvent to change 
style="display: block;" to style="display: none;" through Javascript and Perl.  
But, I'm looking at building a more sophisticated application.  I've tried 
calling webViewShow again with no results.

I'm on the Sl4a r3 and Android 2.2

Thanks in advance for your help.

Jack

Original issue reported on code.google.com by jck...@gmail.com on 1 Nov 2010 at 8:54

Copied from original issue: damonkohler/android-scripting#467

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

Also, when I exit the Perl script, the webview will not close.  I've tried 
useing window.close() inside of the webview with no effect.

Please give me a recommendation on how to close the webview.

Thanks
Jack

Original comment by jck...@gmail.com on 3 Nov 2010 at 3:46

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

Original comment by damonkoh...@gmail.com on 6 Nov 2010 at 9:26

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

I use a python script and even the sys.exit() doesn't close the web page.
I don't know how to do it.

Original comment by iloc...@gmail.com on 20 Nov 2010 at 4:52

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

I use webViewShow and after refresh page in webview (javascript 
location.replace() ) script for waitForEvents in page is not function. And 
webViewShow should not close.

Original comment by milan...@gmail.com on 24 Nov 2010 at 1:47

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

Is there a suggested work around?  Or, will this be fixed soon?  I have several 
apps ready to release but this is a show stopper for me.

Thanks

Original comment by jck...@gmail.com on 6 Dec 2010 at 7:49

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

Sorry, no ETA. Also, there's no workaround that I'm aware of.

Original comment by damonkoh...@gmail.com on 10 Dec 2010 at 10:42

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

surely the ability to close can be patched through the API from the webview 
class in the android library...?

Original comment by JMCobb@gmail.com on 25 Mar 2011 at 5:48

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

[deleted comment]
damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

Hello guys, here are 2 patches that add methods from the webview to dismiss it.

The java patch adds the needed wrappers using the standard Android JS 
interface, while the js patch simply exposes the dimiss method in the Android 
object when you are in JS.

Sorry Robbie but I have no freaking idea on how to clone your repository and do 
a pull request like I do on gitorious. Can you commit it please? I made them 
against your tree.

Original comment by naranjo....@gmail.com on 22 Apr 2011 at 3:53

Attachments:

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

Hello everybody

Can anyone say me how to apply these patches? I need to close webviews in a 
SL4A development, but I don't know how to make it :( 

Original comment by jmar...@zikzakmedia.com on 27 Oct 2011 at 10:12

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

im not shure but try that

move *.diff files to sdcard, run sl4a and open shell interpreter and type

$applypatch -c /sdcard/download/HtmlActivityTask.java.diff
$applypatch -c /sdcard/download/android.java.diff

Original comment by dsso...@gmail.com on 24 Jan 2012 at 4:41

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

I have a few questions about the patches submitted by Manuel:
1) have they been incorporated in the latest releases (I am using  sl4a_r5x)
2) if not, has someone successfully applied them to a some version? which one?
3) assuming I have a patched sl4a, how do I dismiss a webView?

Original comment by giovanni...@gmail.com on 8 May 2012 at 3:24

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

Finally, I had to desist to use sl4a because after seven clicks in buttons, the 
app always was broken.

Original comment by jmar...@zikzakmedia.com on 8 May 2012 at 4:43

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28


I opened this issue originally.  I have since abandoned sl4a and moved to Java. 
 I was using Perl and sl4a with WebView for all user interactions.  It was a 
neat solution, but, too many problems and a lot of shortcomings. sl4a allowed 
me to re-use a lot of my pre-existing Perl code from other applications.  sl4a 
needs more time to mature.  

Original comment by jck...@gmail.com on 8 May 2012 at 5:18

damonkohler commented 9 years ago

From @GoogleCodeExporter on May 31, 2015 11:28

In the latest sl4a (r6_3) this issue has been resolved -- narajo's patch was 
apparently applied.  Now, you just need to call:

droid.dismiss()

from JavaScript to exist the webview. Works great!

Original comment by eric@ericbullington.com on 18 Jul 2013 at 7:25