You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/09/12 05:43:46 UTC

[GitHub] sandeep2244 opened a new issue #494: Change from CordovaWebView to SystemWebView in latest Cordova not working

sandeep2244 opened a new issue #494: Change from CordovaWebView to SystemWebView in latest Cordova not working
URL: https://github.com/apache/cordova-android/issues/494
 
 
   
       I stuck in my old version Android App based on Codova
       I updated My Android App to latest version android@7.0.0
   
   Now where i used CordovaWebView for for Webview in my app as follows
   
   ```
   <org.apache.cordova.CordovaWebView
            android:id="@+id/cordovaWebCallWebView"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
   ```
   
   but it's not present in latest version of Cordova. So I changed to it by below lines
   
        <org.apache.cordova.engine.SystemWebView
        android:id="@+id/SystemWebView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
   
   where i am using WebRtc for my App So I used following method of SystemWebView Class
   
   ```
   cwv.setWebChromeClient(new WebChromeClient() {
   
               @Override
               public void onPermissionRequest(final PermissionRequest request) { 
                   javaToJavascript.webrtcCallLog("web.java", "permission asked is"+Arrays.deepToString(request.getResources()),0); //This logs the type of permission asked
                   Log.i("The list of permission asked is ", Arrays.deepToString(request.getResources())); // this askes for android.webkit.resource.AUDIO_CAPTURE permission
   
                   getActivity().runOnUiThread(new Runnable() {
                       @TargetApi(Build.VERSION_CODES.LOLLIPOP)
                       @Override
                       public void run() {
                           Log.i("Value Of the permission asked is ", request
                                   .getOrigin().toString());
   
                           request.grant(request.getResources());
   
                       }
                   });
   
               }
           });
   ```
   Now i got runtime error in my Main java file regarding classCastException
   
       java.lang.RuntimeException: Unable to start activity ComponentInfo{com.simCard.web/com.simCard.web.WebCall}: java.lang.ClassCastException: com.simCard.web.WebCall$1 cannot be cast to org.apache.cordova.engine.SystemWebChromeClient
   
   How to solve This error ? Please any ones help will be grateful
   
   Thank you

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org