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/17 06:18:45 UTC

[GitHub] sandeep2244 opened a new issue #15: Class can't cast to SystemWebChromeClient

sandeep2244 opened a new issue #15: Class can't cast to  SystemWebChromeClient 
URL: https://github.com/apache/cordova/issues/15
 
 
   Hello,
   I am using latest apache cordova android version 
   
   I have old code for embeding webview and I have connection with WebRtc 
   
   So **i have to override setWebChromeClient**  method of SystemWebview.java file for Webrtc connection 
   
   
   my code snippet is below 
   
   ```
   
   SystemWebView   cwv =  (SystemWebView) findViewById(R.id.SystemWebView);
   
   cwv.setWebChromeClient(new WebChromeClient() {
   
   				@Override
   				public void onPermissionRequest(final PermissionRequest request) { // this for webrtc connection
   
   		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());
   
   						}
   					});
   
   				}
   
   
   ```
   
   **And SystemWebview.java Method is as follows** 
   
   ```
   
       @Override
       public void setWebChromeClient(WebChromeClient client) {
           chromeClient = (SystemWebChromeClient)client;
           super.setWebChromeClient(client);
       }
   
   ```
   Now i got error regarding 
   
   > My class (WebCall)  cant cast to SystemWebChromeClient 
   
   I stuck in this problem since 20 to 30 days...
   Please any help would be appreciable   
   

----------------------------------------------------------------
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