Code Monkey home page Code Monkey logo

Comments (9)

mbppower avatar mbppower commented on July 18, 2024

That seems to be a problem with Cordova version 5. I'll need to see the API changes and correct that issue.

from cordova-plugin-camera-preview.

 avatar commented on July 18, 2024

I changed code to
webView.getView().setBackgroundResource(0x00000000);
ViewGroup g = (ViewGroup)webView.getView().getParent();

but not helping much. Error got removed but camera is not going to background like before

from cordova-plugin-camera-preview.

io-pan avatar io-pan commented on July 18, 2024

I have the same issue: cordova 5.0.0, building app for android 4.4.2 (API 19)

All is ok except sending camera to back, I get these errors:
method getParent() is undefined for the type CordovaWebView
method setBackgroundColor(int) is undefined for the type CordovaWebView

I've tried to cast types but this doesn't work either.

I managed once to make it work by orverwriting files with the CordovaCameraPreviewApp files. But as soon I closed eclipse and re-open my project, these 2 errors came back.

from cordova-plugin-camera-preview.

marcorivm avatar marcorivm commented on July 18, 2024

Any news on this? also facing this problem

from cordova-plugin-camera-preview.

antidiestro avatar antidiestro commented on July 18, 2024

+1, any news regarding this issue?

from cordova-plugin-camera-preview.

io-pan avatar io-pan commented on July 18, 2024

@mbppower : what version number of cordova are you using ?

from cordova-plugin-camera-preview.

mbppower avatar mbppower commented on July 18, 2024

They've changed some things on the version 5. I was using Cordova 4.

from cordova-plugin-camera-preview.

SeanChenU avatar SeanChenU commented on July 18, 2024

Finally found a possible solution for this issue. Change the code

webView.setBackgroundColor(0x00000000);
ViewGroup g = (ViewGroup)webView.this.getParent();
g.setBackgroundColor(0x00000000);
g.bringToFront();

to

webView.getView().setBackgroundColor(0x00000000);
((ViewGroup)webView.getView()).bringToFront();

The class CordovaWebView in Cordova 5 is no longer inherited from WebView class in android. So the getParent() and setBackgroundColor() don't work. The down side of sending the camera preview box to the back of the webView is you can't drag the preview box.

from cordova-plugin-camera-preview.

io-pan avatar io-pan commented on July 18, 2024

Well done SeanChenU.
this works perfectly for me.

from cordova-plugin-camera-preview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.