Xamarin Labs Hybrid Web View not calling callback in some specific android devices

910 views Asked by At

I have a Hybrid web view from labs that calls a JS and show the return... It is working in emulator and other devices such as Samsung Galaxy S5... But in my Galaxy S2 and on a Sony Xperia it is not working.... took away some code that were not important

my class:

public class TestPage : ContentPage
{


    HtmlWebViewSource hwvsource = new HtmlWebViewSource();


    HybridWebView hwv = new HybridWebView() { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand };

    StackLayout stack = new StackLayout { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand };


    public TestPage ()
    {



        this.hwv.RegisterCallback ("dataCallback", JSCallback);

        //script that receives a list and call Native('dataCallback', list); ....
    this.hwvsource.Html = @"
            <!DOCTYPE html>
                <html>
                    <head>
                     <script language=""javascript"">
                    Native('dataCallback', list);
                   </script>
                    </head>  
                 </html>";

        this.hwv.Source = hwvsource;


        stack.Children.Add(activityIndicator);
        stack.Children.Add(hwv);
        stack.Children.Add(listView);

        this.Content = stack;

        this.hwv.LoadFinished += (object sender, EventArgs e) =>
        {

            this.hwv.IsVisible = false;
        }; 



    }


    private void JSCallback(string result){
        DisplayAlert ("callback", result, "ok");

    }


}

My Application output is it:

[Trace] error opening trace file: No such file or directory (2)
[monodroid] Trying to load sgen from: /data/app-lib/app.Droid-1/libmonosgen-2.0.so
[monodroid-gc] GREF GC Threshold: 46080
[libEGL] loaded /system/lib/egl/libEGL_mali.so
[libEGL] loaded /system/lib/egl/libGLESv1_CM_mali.so
[libEGL] loaded /system/lib/egl/libGLESv2_mali.so
[] Device driver API match
[] Device driver API version: 17
[] User space API version: 17 
[] mali: REVISION=Linux-r3p1-01rel1 BUILD_DATE=Tue Jul  2 15:06:24 KST 2013 
[OpenGLRenderer] Enabling debug mode 0
[SpannableStringBuilder] SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
[SpannableStringBuilder] SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
[SpannableStringBuilder] SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
[SpannableStringBuilder] SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
[IInputConnectionWrapper] clearMetaKeyStates on inactive InputConnection
[IInputConnectionWrapper] getExtractedText on inactive InputConnection
[IInputConnectionWrapper] getTextBeforeCursor on inactive InputConnection
[IInputConnectionWrapper] getSelectedText on inactive InputConnection
[IInputConnectionWrapper] getTextAfterCursor on inactive InputConnection
[libc] protoent* getprotobyname(char const*)(3) is not implemented on Android
[libc] protoent* getprotobyname(char const*)(3) is not implemented on Android
[libc] protoent* getprotobyname(char const*)(3) is not implemented on Android
[Choreographer] Skipped 32 frames!  The application may be doing too much work on its main thread.
[dalvikvm-heap] Grow heap (frag case) to 11.443MB for 5760016-byte allocation
Location ViewModel Messaging
*****Here*****
[TilesManager] Starting TG #0, 0x528e53f8
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[PicturePileLayerContent] Warning: painting PicturePile without content!
[webcore] skip viewSizeChanged as w is 0

How I said it works fine in other devices but S2

Any idea what could be?

0

There are 0 answers